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 authored Jan 12, 2024
1 parent 68308aa commit e901584
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 @@ -819,6 +819,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 e901584

Please sign in to comment.