ejrgilbert / whamm

5 stars 2 forks source link

Specify first `EmittingInstrTracker` #74

Closed ahuoguo closed 2 days ago

ahuoguo commented 1 week ago

62 I'm going to summarize the issue this PR fixes since the issue is quite messy

(module
  (type (;0;) (func))
  (type (;1;) (func (param i32 i32) (result i32)))
  (func (;0;) (type 0))
  (func (;1;) (type 0)
    call 0
    call 0)
  (memory (;0;) 1))

with

wasm:bytecode:call:alt { }

should erase the two call 0s, but the output file

(module
  (type (;0;) (func))
  (type (;1;) (func (param i32 i32) (result i32)))
  (type (;2;) (func (param i32 i32 i32 i32) (result i32)))
  (func (;0;) (type 2) (param i32 i32 i32 i32) (result i32) ...) ;;strcmp
  (func (;1;) (type 0)
    call 2)
  (func (;2;) (type 0))
  (memory (;0;) 1))

still has one call 2 because it does not instrument the first event

ejrgilbert commented 5 days ago

I'm a bit confused. Does this PR actually fix the behavior you have in the description? Your wording makes it seem like the behavior is still incorrect.