-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid using integer_typet where unsuitable #1035
Conversation
Don't see anything obviously objectionable (although, test failures so clearly something broke), but I prefer #1016 because it causes less churn. |
270de01
to
d6c6d5b
Compare
d6c6d5b
to
2d0a718
Compare
d2cc0a2
to
b3da32b
Compare
@@ -1413,40 +1423,46 @@ codet java_bytecode_convert_methodt::convert_instructions( | |||
const bool is_double('d'==type_char); | |||
const bool is_float('f'==type_char); | |||
|
|||
if(is_double || is_float) | |||
if(is_double || is_float) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird indentation
irep_idt number=to_constant_expr(arg).get_value(); | ||
mp_integer number; | ||
if(to_integer(to_constant_expr(arg), number)) | ||
throw "failed to extract number"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a user-facing error or an invariant/precondition? (same question regarding other throws below)
else | ||
value.from_expr(to_constant_expr(arg0)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This blank line actually adds to readability.
bool ret=to_integer(to_constant_expr(arg0), int_value); | ||
INVARIANT(!ret, "?ipush argument should be an integer"); | ||
results[0]=from_integer(int_value, java_int_type()); | ||
results[0]=arg0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to change assumptions on arg0 (need not be a constant nor of java_int_type). Please clarify.
b3da32b
to
694490d
Compare
@peterschrammel I hope to have addressed all comments. |
25e9879
to
b21e255
Compare
|
The one gain is that in those cases where "often" does not apply, and after all this is where the bug fix had been necessary. Looking at my changes, there are actually a number of places that had some sort of type casting going on -- sometimes conditional, sometimes not. Really this is a design problem, because passing an integer that is first turned into a string and then back to the original integer is questionable, irrespective of whether this is done via ID_integer or ID_signedbv. |
fb2bf24
to
88d1df7
Compare
This fails to build because of the change to the scope of integer_constant, but otherwise seems ready to go. |
c010115
to
471a2f2
Compare
Unless I've broken some other aspect this should now be addressed. |
The solver back end cannot necessarily handle unbounded integers. Do not use them unless explicitly requested/supported.
471a2f2
to
e2ed0df
Compare
The solver back end cannot necessarily handle unbounded integers. Do not use
them unless explicitly requested/supported.
Fixes: #1015
This is an alternative approach over #1016.