This change adds fatal error messages for various error conditions that
will be added later in the code.
This also addresses a TODO now that we have reportCheckFailed (which
lead me to notice a few variables that were not cased properly so I
changed that as well).
Details
Diff Detail
- Repository
- rCRT Compiler Runtime
Event Timeline
lib/scudo/standalone/report.cc | ||
---|---|---|
11 | Nit: Newline between {report.h} and {atomic_helpers.h, string_utils.h}. Module header should be first, but putting the module header and subproject headers together without a newline makes them look like they should be in sorted order. | |
lib/scudo/standalone/report.h | ||
37 | Is there a reason why the use of this enum is deliberately occluded from those who use it? Why don't you use this as an enum class AllocatorAction with an internal toString method, and then reportInvalidChunkState(..) and others can take AllocatorAction Action as the first argument, instead of occluding it into a u8? This would also remove the need to have ActionsCount and check-fail on this (report.cc:115), as you would have compile-time guarantees that the provided enum value is in range. |
lib/scudo/standalone/report.h | ||
---|---|---|
37 | I think the only reasoning I had was to try and keep things compact, uploading a version that hopefully fits the requirements. |
lib/scudo/standalone/report.cc | ||
---|---|---|
63 | s/cause/caused | |
64 | s/a pointer than/or a pointer that | |
80 | I don't understand what this means exactly. Maybe you mean something like: "The allocator was compiled with parameters that conflict with field size requirements." | |
lib/scudo/standalone/tests/report_test.cc | ||
32 | Test for AllocatorAction::Sizing? |
lib/scudo/standalone/report.cc | ||
---|---|---|
109 | Could this be implemented as a member function of enum class AllocatorAction? |
LGTM
lib/scudo/standalone/report.cc | ||
---|---|---|
109 | Scrap this, I could have sworn that this was possible, turns out I'm mistaken! |
Is there a reason why the use of this enum is deliberately occluded from those who use it? Why don't you use this as an enum class AllocatorAction with an internal toString method, and then reportInvalidChunkState(..) and others can take AllocatorAction Action as the first argument, instead of occluding it into a u8?
This would also remove the need to have ActionsCount and check-fail on this (report.cc:115), as you would have compile-time guarantees that the provided enum value is in range.