-
Notifications
You must be signed in to change notification settings - Fork 273
Overwrite String functions in final step of bytecode conversion #983
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
Changes from all commits
0dcb773
ca32a0a
dcf7614
65f2e36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1550,17 +1550,11 @@ codet java_bytecode_convert_methodt::convert_instructions( | |
symbol.type=arg0.type(); | ||
symbol.value.make_nil(); | ||
symbol.mode=ID_java; | ||
|
||
assign_parameter_names( | ||
to_code_type(symbol.type), | ||
symbol.name, | ||
symbol_table); | ||
|
||
// The string refinement module may provide a definition for this | ||
// function. | ||
symbol.value=string_preprocess.code_for_function( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this being removed? The commit message "Removing string conversion from method conversion" is not explicit enough in this regard? It might be more apparent to someone who is already familiar with the code, but I'm not, so this is potentially changing the semantics of this code if the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method that is added below ( |
||
id, to_code_type(symbol.type), loc, symbol_table); | ||
|
||
symbol_table.add(symbol); | ||
} | ||
|
||
|
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.
These changes make me a little bit anxious that the semantics of the code have changed. Before the change, the
if...else if...else
cascading conditional statement means that there is a single set of 3 possible consequence expressions, only 1 of which will be evaluated.This change has essentially broken the one set (of consequent statements/expressions) into two sets, one with one consequence and the other with 2, both of which can be evaluated independently of each other, just based on their conditions.
What I mean with this, that only one consequent expression could be evaluated at a point in time (because they were exclusive due to the way the conditional statement was written), now 2 consequent expressions can be evaluated at the same time. Do we want this?
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.
Yes we now want to replace string types even if they are loaded.
The idea behind this is that we will provide through the
models-library
a String class which will be loaded in the classpath, but we still want to use the type we define internally for strings.The class still needs to be converted though, because we want to use some methods that are defined in the String.class provided.