-
Notifications
You must be signed in to change notification settings - Fork 123
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
Identify invalid IBDO data/array modifications. #538
Identify invalid IBDO data/array modifications. #538
Conversation
170619a
to
27c789f
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.
Overall approach looks good. Could use a little cleanup to improve readability and maintainability.
See commit 7e901af on the PR_538_extract_SafeUsageChecker branch for a suggested refactor to help isolate the safe usage checks.
27c789f
to
95fc212
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.
More cleanup recommendations. All are cosmetic, aimed at improving maintainability.
95fc212
to
16dab83
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 great 🚀
Should this be feature flagged and defaulted to off to begin integration? |
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.
Awaiting response on feature-flag feedback.
Should be relatively easy to add a SafeUsageChecker.cfg file with an |
0a26a76
16dab83
to
0a26a76
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.
Minor tweaks suggested, notably correcting an assertion message ("true" vs "false")
4f7a4c1
to
9c1e6e6
Compare
9c1e6e6
to
1ccf908
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.
well done
This PR identifies invalid modifications to the IBDO data/array. This pertains only to IBDO data returned as a byte array since data returned as a ChannelFactory is immutable. An invalid modification is when a byte array is returned, the elements are modified and IBDO.setData(...)/IBDO.setChannelFactory(...) is NOT called. The problem occurs when the IBDO data is backed by a channel factory, a byte array is created and returned from the ChannelFactory, the byte array is modified and then the place competes with the byte array being garbage collected without the modifications being given back to the IBDO.