-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/assert rc #71
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
Conversation
xFrednet
left a comment
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.
Decent overall, please also check the CI
| }); | ||
| } | ||
|
|
||
| void assert_rc__function_impl( |
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.
| void assert_rc__function_impl( | |
| void assert_rc_function_impl( |
| } | ||
| // Remove string object whitespace | ||
| auto s = count_str->get_name(); | ||
| if (s[0] == '\"') |
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 can be undefined behaviour, if the string is empty
|
|
||
| void test_builtins() | ||
| { | ||
| // Onus is on caller to provide a string object representing an actual integer |
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.
Onus?
| expected = "2" | ||
| assert_lrc(r1, expected) | ||
| # Using string directly | ||
| assert_lrc(r1, "2") No newline at end of file |
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.
| assert_lrc(r1, "2") | |
| assert_lrc(r1, "2") | |
Some in the other files
| @@ -0,0 +1,3 @@ | |||
| # Not a string | |||
| a = {} | |||
| assert_lrc(a, a) No newline at end of file | |||
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.
The first argument should be a bridge
| auto count_str = frame->stack_pop("count_str"); | ||
| auto bridge = frame->stack_pop("bridge"); | ||
| // Make sure we're comparing the correct LRC value | ||
| rt::remove_reference(frame->object(), bridge); |
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 can cause undefined behaviour of the RC hits 0.
Builtin functions to assert lrc/sbrc