-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Decompiler] Don't crash when crash-start is on a NOOP (#38)
* Don't dereference map iterators to objects in comparison * Fix assert message when MIR is not generated
- Loading branch information
1 parent
3c54c76
commit 3362e44
Showing
8 changed files
with
160 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+264 KB
llvm-10.0.1/llvm-crash-analyzer/test/Decompiler/Inputs/core.nop_crashstart
Binary file not shown.
Binary file added
BIN
+19.2 KB
llvm-10.0.1/llvm-crash-analyzer/test/Decompiler/Inputs/nop_crashstart
Binary file not shown.
41 changes: 41 additions & 0 deletions
41
llvm-10.0.1/llvm-crash-analyzer/test/Decompiler/decompile-to-mir-nop_crashstart.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## Test Machine Functions decompiled correctly when crashstart is on a nop | ||
## to reproduce the executable, use gcc to compile: | ||
## | ||
## void do_things (int); | ||
## | ||
## struct s_t { | ||
## int a; | ||
## void (*fptr)(int); | ||
## }; | ||
## struct s_t s1 = {1,do_things}; | ||
## struct s_t s2 = {2,do_things}; | ||
## struct s_t *sptr; | ||
## | ||
## struct s_t *get_ptr (void) { | ||
## return sptr; | ||
## } | ||
## | ||
## void do_things (int a) { | ||
## *((int *) 1 ) = a; | ||
## } | ||
## | ||
## void initiate (int val) { | ||
## struct s_t *ptr = get_ptr (); | ||
## ptr->fptr (val); | ||
## } | ||
## | ||
## int main (int argc, char **argv) { | ||
## if (argc > 0) | ||
## sptr = &s1; | ||
## else | ||
## sptr = &s2; | ||
## | ||
## initiate (argc); | ||
## return 0; | ||
## } | ||
|
||
# RUN: %llvm-crash-analyzer --print-decompiled-mir=%t.mir \ | ||
# RUN: --core-file=%S/Inputs/core.nop_crashstart %S/Inputs/nop_crashstart | FileCheck %s | ||
|
||
# CHECK: Decompiled. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+264 KB
llvm-15.0.3/llvm-crash-analyzer/test/Decompiler/Inputs/core.nop_crashstart
Binary file not shown.
Binary file added
BIN
+19.2 KB
llvm-15.0.3/llvm-crash-analyzer/test/Decompiler/Inputs/nop_crashstart
Binary file not shown.
Oops, something went wrong.