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

Frog: Missing check with --enable_type_checks on && and || #448

Closed
rakudrama opened this issue Nov 15, 2011 · 2 comments
Closed

Frog: Missing check with --enable_type_checks on && and || #448

rakudrama opened this issue Nov 15, 2011 · 2 comments
Assignees

Comments

@rakudrama
Copy link
Member

This program runs without signalling that isList is not bool on the first iteration.
The VM signals an error.

main() {
  var a = 123;
  var isList = 0;
  for (int i = 0; i < 4000; i++) {
    isList = isList || a is List;
  }
  print('a is List == $isList');
}

The generated code for the assignment is:
isList = $notnull_bool(isList || !!(a && a.is$List));

I would have expected
isList = $notnull_bool(isList) || !!(a && a.is$List);

The placement of the check is even stranger with an expression like

b = b && x > 5 && x < 10;

--->
b = $notnull_bool(b && x > 0) && x < 100;

@jmesserly
Copy link

this was a pretty silly bug, it was converting the result of && to bool instead of the arguments. Fix incoming

@jmesserly
Copy link

Added Fixed label.

This issue was closed.
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

2 participants