go-interpreter / wagon

wagon, a WebAssembly-based Go interpreter, for Go.
BSD 3-Clause "New" or "Revised" License
904 stars 148 forks source link

1/4 - Implementent native compilation - Fix stack allocation & depths, add debug mode to find these issues. #111

Closed twitchyliquid64 closed 5 years ago

twitchyliquid64 commented 5 years ago

Sooooo I found an issue where the stack size is wrong (two situations - calling into a compiledFunction, and when the function returns a value onto the parents stack). This was masked by the use of append, which transparently reallocates the slice.

This PR fixes this, and introduces debugStackDepth (which compiles away to nothing when disabled).

codecov-io commented 5 years ago

Codecov Report

Merging #111 into master will decrease coverage by 0.03%. The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
- Coverage    68.9%   68.87%   -0.04%     
==========================================
  Files          33       33              
  Lines        3345     3351       +6     
==========================================
+ Hits         2305     2308       +3     
- Misses        783      785       +2     
- Partials      257      258       +1
Impacted Files Coverage Δ
exec/func.go 75.51% <100%> (ø) :arrow_up:
exec/vm.go 85.88% <62.5%> (-0.89%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a76146c...9aee6d3. Read the comment docs.

twitchyliquid64 commented 5 years ago

Friendly ping on this PR and the others :) Hope dotGo went well :D

twitchyliquid64 commented 5 years ago

:smiley:

twitchyliquid64 commented 5 years ago

Thanks :)

Please see https://github.com/go-interpreter/license/pull/14.