File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,11 @@ struct Run: ParsableCommand {
54
54
}
55
55
56
56
let interceptor = try deriveInterceptor ( )
57
+ #if !DEBUG
58
+ guard interceptor == nil else {
59
+ fatalError ( " Internal Error: Interceptor API is unavailable with Release build due to performance reasons " )
60
+ }
61
+ #endif
57
62
defer { interceptor? . finalize ( ) }
58
63
59
64
let invoke : ( ) throws -> Void
Original file line number Diff line number Diff line change @@ -119,9 +119,11 @@ extension ExecutionState {
119
119
120
120
private mutating func endOfFunction( runtime: Runtime , currentFrame: Frame ) throws {
121
121
// When reached at "end" of function
122
- // if let address = currentFrame.address {
123
- // runtime.interceptor?.onExitFunction(address, store: runtime.store)
124
- // }
122
+ #if DEBUG
123
+ if let address = currentFrame. address {
124
+ runtime. interceptor? . onExitFunction ( address, store: runtime. store)
125
+ }
126
+ #endif
125
127
let values = stack. popValues ( count: currentFrame. arity)
126
128
stack. popFrame ( )
127
129
stack. push ( values: values)
Original file line number Diff line number Diff line change @@ -62,7 +62,9 @@ extension ExecutionState {
62
62
/// > Note:
63
63
/// <https://webassembly.github.io/spec/core/exec/instructions.html#invocation-of-function-address>
64
64
mutating func invoke( functionAddress address: FunctionAddress , runtime: Runtime ) throws {
65
- // runtime.interceptor?.onEnterFunction(address, store: runtime.store)
65
+ #if DEBUG
66
+ runtime. interceptor? . onEnterFunction ( address, store: runtime. store)
67
+ #endif
66
68
67
69
switch try runtime. store. function ( at: address) {
68
70
case let . host( function) :
You can’t perform that action at this time.
0 commit comments