-
Notifications
You must be signed in to change notification settings - Fork 932
Revert D100115639 #18800
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
base: main
Are you sure you want to change the base?
Revert D100115639 #18800
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,6 @@ | |
|
|
||
| #pragma once | ||
|
|
||
| #include <c10/util/safe_numerics.h> | ||
| #include <executorch/runtime/core/data_loader.h> | ||
| #include <executorch/runtime/core/error.h> | ||
| #include <executorch/runtime/core/result.h> | ||
|
|
@@ -34,12 +33,10 @@ class SharedPtrDataLoader final : public executorch::runtime::DataLoader { | |
| size_t offset, | ||
| size_t size, | ||
| ET_UNUSED const DataLoader::SegmentInfo& segment_info) const override { | ||
| size_t total_size; | ||
| bool overflow = c10::add_overflows(offset, size, &total_size); | ||
| ET_CHECK_OR_RETURN_ERROR( | ||
| !overflow && total_size <= size_, | ||
| offset + size <= size_, | ||
| InvalidArgument, | ||
| "offset %zu + size %zu > size_ %zu, or overflow detected", | ||
| "offset %zu + size %zu > size_ %zu", | ||
| offset, | ||
| size, | ||
| size_); | ||
|
Comment on lines
36
to
42
|
||
|
|
||
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 check still uses
c10::add_overflows(...)and fails when overflow is detected, but the error message no longer mentions overflow. Either restore the message text to include overflow, or restructure the validation so the message matches the actual failure conditions.