Skip to content

Commit

Permalink
fix panicking and stack traces (#23)
Browse files Browse the repository at this point in the history
* polkawasm: fix misused function putchar
* polkawasm: revert wasm-opt -g flag
  • Loading branch information
radkomih committed Apr 1, 2024
1 parent 2134248 commit 03d8c38
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions builder/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,7 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe
if config.Target.Triple == "wasm32-unknown-polkawasm" {
args = append(args,
opt,
"-g",
"--signext-lowering",
// "--signature-pruning",
// "--const-hoisting",
Expand Down
3 changes: 2 additions & 1 deletion src/runtime/gc_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func printstr(str string) {
break
}

putchar(str[i])
putcharBuffer[putcharPosition] = str[i]
putcharPosition++
}
}
5 changes: 1 addition & 4 deletions src/runtime/runtime_polkawasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ func abort() {
trap()
}

func putchar(c byte) {
putcharBuffer[putcharPosition] = c
putcharPosition++
}
func putchar(c byte) {}

func getchar() byte {
return 0
Expand Down

0 comments on commit 03d8c38

Please sign in to comment.