Skip to content
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

String -> int coercions can choose inappropriate strings. #112

Open
BenSpencer opened this issue Jun 3, 2014 · 1 comment
Open

String -> int coercions can choose inappropriate strings. #112

BenSpencer opened this issue Jun 3, 2014 · 1 comment

Comments

@BenSpencer
Copy link
Contributor

See new test case in 647ad24.

It seems that the solver considers the coercion of all strings to be <0. This means that when a condition requires a negative value sometimes a string can be generated instead of an integer. If the string does not happen to match the condition under JavaScript's comparison rules then the branch will be missed.

I have asked the CVC4 guys about this, but if it is expected behaviour then we will need to generate some extra constraints in these cases to restrict what solutions are appropriate to match the JavaScript's behaviour.

@BenSpencer BenSpencer self-assigned this Jun 3, 2014
@BenSpencer
Copy link
Contributor Author

It is the expected behaviour of the solver to report -1 as the integer value of arbitrary strings.

To solve this we will need to model the semantics of JavaScript casting/coercions.

@BenSpencer BenSpencer removed their assignment Jun 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant