forked from OffchainLabs/nitro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CaptureHostIO when slices are bigger than 2^16
Support slices bigger than 2^16 when capturing a HostIO for tracing. This could be reproduced with the test case added in the commit.
- Loading branch information
1 parent
26cda07
commit 8517fb0
Showing
3 changed files
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
;; Copyright 2024, Offchain Labs, Inc. | ||
;; For license information, see https://github.com/nitro/blob/master/LICENSE | ||
|
||
(module | ||
(import "vm_hooks" "read_args" (func $read_args (param i32))) | ||
(import "vm_hooks" "write_result" (func $write_result (param i32 i32))) | ||
(memory (export "memory") 2 2) | ||
(func $main (export "user_entrypoint") (param $args_len i32) (result i32) | ||
(local $len i32) | ||
|
||
;; write args to 0x0 | ||
(call $read_args (i32.const 0)) | ||
|
||
;; treat first 4 bytes as size to write | ||
(i32.load (i32.const 0)) | ||
local.set $len | ||
|
||
;; call write | ||
(call $write_result (i32.const 0) (local.get $len)) | ||
|
||
;; return success | ||
i32.const 0 | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters