-
Notifications
You must be signed in to change notification settings - Fork 160
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
Fix a number of bugs in SyntaxTree
and SyntaxTreeCode
#5165
Conversation
@@ -864,7 +866,7 @@ static const CompilerT Compilers[] = { | |||
COMPILER_(EXPR_ELMS_LIST_LEV, | |||
ARG_EXPR_("lists"), | |||
ARG_EXPR_("poss"), | |||
ARG_EXPR_("level")), | |||
ARG_EXPR("level", ObjInt_UInt, UInt_ObjInt)), |
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.
Ahhh, that makes sense. Nice catch!
b186c98
to
18587f2
Compare
Thanks a lot, works perfectly! And it confirms my expectation that a stack of While reading the documentation again, I noticed that this level thing also exists for the usual list access (
Note: This is in no way important for me, I'm just trying to find further ways to produce crashes :D |
Thanks @zickgraf , good catch. Perhaps @ChrisJefferson will also fix that, too :-) |
This PR grew slightly out of control while fixing some other SYNTAX_TREE issues, I'm happy to pull it apart. Now it contains: (outside of SYNTAX_TREE) while tracking down a crash I added asserts to SIZE_EXPR. This revealed for chars we make bags of size uchar(1), which mean we shouldn't the read and write Exprs (which are size 8) from them. As we already round allocations up to word size this wasn't actually doing any harm in practice, but let's fix it anyway. I also (this is the slightly horrible code) generalised the SYNTAX_TREE code to support variadics in the middle of an object. |
43845ec
to
253b48a
Compare
253b48a
to
8accf58
Compare
Just to point out (in particular if @zickgraf is using this), this PR changes how matrix indexing is done, to make it (correctly) handle 2d matrices. Also (last push, as I'm sat in the airport), I decided to add an assert which makes sure all of an expr is used in SyntaxTree. This showed up a bug in handling EXPR_REC_TILDE. On deep investigation, it turns out this doesn't need to be handled differently (as we don't need to worry here where the tildes bind to, just preserve their presence). |
Added an assert which checks all of an expr is used during SYNTAX_TREE. This showed that EXPR_REC_TILDE wasn't implemented.
8b23774
to
fb831bc
Compare
Lots of changes were made after my review
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.
Thanks for the effort! I have run all of my tests using this PR and there are no regressions :-)
SyntaxTree
and SyntaxTreeCode
I believe this fixes #5117, but it would be good if @zickgraf could have a look.
Note that this changes some previously generated trees (see the diff), but I believe they were always wrong, it's just that the integer
1
was being interpreted as an Expr (where it is0
), but the integer2
interpreted as an Expr caused a crash.