Skip to content

Commit 84c1b66

Browse files
committed
add verify in run processing
1 parent 6ab9078 commit 84c1b66

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

wasm_interpreter.go

+4
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ func (w *WasmIntptr) Run(contract *Contract, input []byte) ([]byte, error) {
200200
}
201201

202202
mainIndex, err := w.verifyModule(module)
203+
if err != nil {
204+
return nil, err
205+
}
203206

204207
vm, err := exec.NewVM(module)
205208
if err != nil {
@@ -221,6 +224,7 @@ func (w *WasmIntptr) Run(contract *Contract, input []byte) ([]byte, error) {
221224
return w.returnData, err
222225
}
223226

227+
w.terminateType = TerminateInvalid
224228
return nil, errors.New("could not find a valid 'main' function in the code")
225229
}
226230

0 commit comments

Comments
 (0)