-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gnovm): don't assert to bodyStmt when creating stacktraces (#3836)
Stacktraces being generated when executing a known statement, like the initialization of an if statement, will have the panicking statement at the top of the Stmt stack, which may not be a bodyStmt. This PR fixes the incorrect assertion.
- Loading branch information
Showing
2 changed files
with
19 additions
and
2 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
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,16 @@ | ||
package main | ||
|
||
func main() { | ||
var p *int | ||
if i := *p; i == 0 { | ||
println("hey") | ||
} | ||
} | ||
|
||
// Error: | ||
// nil pointer dereference | ||
|
||
// Stacktrace: | ||
// panic: nil pointer dereference | ||
// main<VPBlock(1,0)>() | ||
// main/files/recover20.gno:5 |