-
Notifications
You must be signed in to change notification settings - Fork 280
Refactor logic that checks if a given type represents a Java string #4508
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
Refactor logic that checks if a given type represents a Java string #4508
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 625b803).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/107787207
@@ -29,6 +30,15 @@ bool java_is_array_type(const typet &type) | |||
return is_java_array_tag(to_struct_type(type).get_tag()); | |||
} | |||
|
|||
bool is_java_string_type(const struct_typet &struct_type) | |||
{ | |||
return struct_type.id() == ID_struct && |
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.
Necessarily true of a struct_typet
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.
Interesting, I assumed it wasn't because of the
PRECONDITION(struct_type.id()==ID_struct);
in gen_nondet_struct_init
in the object factory. I removed the equality check that you commented on, and in a new commit I also removed the precondition from the object factory.
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.
That is indeed also redundant (I'm guessing it used to take a typet
)
625b803
to
824b113
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: 824b113).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/107803256
824b113
to
448ce68
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: 448ce68).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/107852500
448ce68
to
8f1b743
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: 8f1b743).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/107860266
This check appears twice in the object factory, and it will also appear in some new code soon, so it makes sense to move it to a util file.
The id() of struct_typets is always ID_struct.
8f1b743
to
a6a0bec
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: a6a0bec).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/107944535
This check appears twice in the object factory, and it will also appear in some new code soon, so it makes sense to move it to a util file.