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

Allow negative logic for the is operator. #212

Merged
merged 2 commits into from Nov 26, 2017
Merged

Allow negative logic for the is operator. #212

merged 2 commits into from Nov 26, 2017

Conversation

ghost
Copy link

@ghost ghost commented Nov 26, 2017

Where variable is type construct is allowed, allow the variable is not type construct too.

Please handle this with the required care and calm... but I think it should be mostly alright.

Safety: frogatto not checked, citadel booting, anura tests passing.

Cheers and Regards,

frogatto plane

Where the `variable is type` construct is allowed, allow the `variable
is not type` construct too.
Copy link
Contributor

@davewx7 davewx7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great other than my one comment.

src/formula.cpp Outdated
@@ -4773,6 +4779,11 @@ static std::string debugSubexpressionTypes(ConstFormulaPtr & fml)
int consume_backwards = 0;
std::string op_name(op->begin,op->end);

if (op_name == "is" && op > i1 && op + 1 > i1 &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to check op + 1 > i1 since op > i1 already guarantees this, however you should check that op + 1 < i2 before using op + 1 to make sure we don't run off the end of the buffer.

The program would be incurring in an illegal memory access when trying
to parse formulae such as e.g. `x is`. Greetings to David White for
seeing the crash coming. ^^U
@davewx7 davewx7 merged commit f88a26b into anura-engine:trunk Nov 26, 2017
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

Successfully merging this pull request may close these issues.

2 participants