-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Validate mpy load #1972
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
Validate mpy load #1972
Conversation
Rollback HID to save string space and remove board mapping for default buses that don't exist.
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.
Good idea!
return mp_parse_num_decimal(vstr.buf, vstr.len, obj_type == 'c', false, NULL); | ||
} | ||
} | ||
raise_corrupt_mpy(); | ||
return MP_OBJ_FROM_PTR(&mp_const_none_obj); |
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 return value is a size_t
, not an mp_obj_t
. If the compiler is forcing you to return something, even though it will never get executed, just return 0, I'd say.
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.
Never mind, confused by diff listing with missing lines.
This should help prevent hard crashes when an mpy file is corrupt.