-
Notifications
You must be signed in to change notification settings - Fork 72
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
grab bag of small UB fixes #2298
Changes from all commits
c241ae5
f2111db
a0b41fc
62e95b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
+2 −2 | application_base.cpp | |
+11 −9 | include/appbase/application_base.hpp |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -40,7 +40,7 @@ memory::memory(uint64_t sliced_pages) { | |||||
uintptr_t* const intrinsic_jump_table = reinterpret_cast<uintptr_t* const>(zeropage_base - first_intrinsic_offset); | ||||||
const intrinsic_map_t& intrinsics = get_intrinsic_map(); | ||||||
for(const auto& intrinsic : intrinsics) | ||||||
intrinsic_jump_table[-intrinsic.second.ordinal] = (uintptr_t)intrinsic.second.function_ptr; | ||||||
intrinsic_jump_table[-(int)intrinsic.second.ordinal] = (uintptr_t)intrinsic.second.function_ptr; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an interesting one. The error here gets reported somewhat confusingly as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
leap/libraries/chain/include/eosio/chain/webassembly/eos-vm-oc/intrinsic_mapping.hpp Lines 18 to 19 in 968a0fa
so int will always be plenty large enough (we won't have 231 host functions). My initial impression of intptr_t is that its purpose/connotation isn't really for indexes in to an array.
I do wonder if |
||||||
} | ||||||
|
||||||
memory::~memory() { | ||||||
|
+1 −1 | include/eosio/chain_conversions.hpp | |
+4 −2 | include/eosio/stream.hpp |
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.
Don't need this for tests to pass: OC in unit tests always has
vm_limit
disabled now (except for the one modified test case), and python integration tests never use OC. But I'd like to use OC + ASAN/UBSAN with nodeos. Such usage is probably "developer enough" where simply disabling this limit is safe when configured that way; i.e. won't trap unsuspecting users. Alternatively could guard this disablement behindEOSVMOC_ENABLE_DEVELOPER_OPTIONS
but ultimately I want to remove that option.