-
Notifications
You must be signed in to change notification settings - Fork 161
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 passing invalid rnams to records #3491
Conversation
ad8de30
to
e091884
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.
Looks good and fixes the problem. I had wondered whether "Record Element" was the correct terminology (as opposed to 'component'), but 29.2 of the manual is called exactly "Record Elements", so I won't complain 🙂
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.
Looks OK (unsurprisingly -- it is essentially equivalent to the fix I cooked up :-). I still have some optional suggestions.
## | ||
gap> r; | ||
rec( ) | ||
gap> \.\:\=(r,RNamObj("y"), 2); |
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.
You could also use ASS_REC
instead of \.\:\=
, that might be a bit easier to grok. Same for ISB_REC
, ELM_REC
, UNB_REC
, of course, though there it's perhaps less of a concern.
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.
I'd prefer to use .:= and friends, are those are what we actually document.
Codecov Report
@@ Coverage Diff @@
## master #3491 +/- ##
==========================================
- Coverage 85.43% 85.42% -0.02%
==========================================
Files 699 699
Lines 346762 346600 -162
==========================================
- Hits 296255 296069 -186
- Misses 50507 50531 +24
|
Cleaned up. In the cleaning up I find one more function (NameRNam) where I could use my new test, so I did. |
tst/testinstall/kernel/records.tst
Outdated
@@ -28,6 +28,8 @@ Error, NameRName: <rnam> must be a positive small integer (not the integer -1) | |||
gap> NameRNam(fail); | |||
Error, NameRName: <rnam> must be a positive small integer (not the value 'fail\ | |||
') | |||
gap> NameRNam(2^29); | |||
Error, NameRName: <rnam> must be a valid rnam (not the integer 536870912) |
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.
This error message (and several before it) still has the old, incorrect NameRName
in it, which is why the Travis tests failed.
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.
sorry, been away from my computer. Now hopefully fixed and poked.
Fixes #3489
This could be backported to 4.10, but seeing how long it has been around for, I don't think that is required.
Text for release notes
Fix crashes when passing invalid arguments to functions for records: \., IsBound\., Unbind\. and \.\:\=