-
Notifications
You must be signed in to change notification settings - Fork 273
byte_extract lowering of string constants [blocks: #2068] #4186
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
Conversation
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.
AFAIK this is all C, not Java stuff, as particularly shown by the unit test which exhibits strings with char size = 8 (Java chars are 16-bit)
@@ -118,6 +119,26 @@ static exprt unpack_rec( | |||
array.copy_to_operands(op); | |||
} | |||
} | |||
else if(src.id() == ID_string_constant) |
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.
I might be wrong, but I think these are not used by Java, so the commit message may need amending
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.
Amended to not have that unnecessary restriction, but I do see results of git grep string_constantt
in jbmc/
as well...
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.
They are used for input
and output
steps only; the Java bytecode parser makes them to describe string literals, but those are later transformed into references to constant java.lang.String
instances, so there are no free-floating constants in the same way as there are in C.
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.
Ah, ok! I guess it must have been some C code where I had seen them in the wild.
9430dfc
to
5c9be0c
Compare
5c9be0c
to
eb01d4c
Compare
4d4e564
to
d532a45
Compare
These need to be handled like arrays of characters.
d532a45
to
9a67ec4
Compare
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 9a67ec4).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/101065754
These need to be handled like arrays of characters.