Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
3fb8e424
Commit
3fb8e424
authored
Feb 20, 2009
by
Moritz Kroll
Browse files
Fixed new_tarval_from_str() for boolean and reference modes (it hurts!!!)
[r25536]
parent
f44b4b12
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/tv/tv.c
View file @
3fb8e424
...
...
@@ -335,10 +335,10 @@ tarval *new_tarval_from_str(const char *str, size_t len, ir_mode *mode)
case
irms_internal_boolean
:
/* match [tT][rR][uU][eE]|[fF][aA][lL][sS][eE] */
if
(
strcasecmp
(
str
,
"true"
))
return
tarval_b_true
;
else
if
(
strcasecmp
(
str
,
"false"
))
if
(
!
strcasecmp
(
str
,
"true"
))
return
tarval_b_true
;
else
if
(
!
strcasecmp
(
str
,
"false"
))
return
tarval_b_false
;
else
/* XXX This is C semantics */
return
atoi
(
str
)
?
tarval_b_true
:
tarval_b_false
;
...
...
@@ -349,7 +349,9 @@ tarval *new_tarval_from_str(const char *str, size_t len, ir_mode *mode)
return
get_tarval
(
fc_get_buffer
(),
fc_get_buffer_length
(),
mode
);
case
irms_reference
:
/* same as integer modes */
if
(
!
strcasecmp
(
str
,
"null"
))
return
get_tarval_null
(
mode
);
/* fall through */
case
irms_int_number
:
sc_val_from_str
(
str
,
len
,
NULL
,
mode
);
return
get_tarval
(
sc_get_buffer
(),
sc_get_buffer_length
(),
mode
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment