This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "[contracts] make
debug_message
execution outcome invariant …
- Loading branch information
Ross Bulat
committed
Feb 19, 2023
1 parent
9b868ed
commit ed98f77
Showing
13 changed files
with
1,065 additions
and
1,373 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,28 +1,18 @@ | ||
;; Emit a debug message with an invalid utf-8 code | ||
;; Emit a "Hello World!" debug message | ||
(module | ||
(import "seal0" "seal_debug_message" (func $seal_debug_message (param i32 i32) (result i32))) | ||
(import "env" "memory" (memory 1 1)) | ||
|
||
(data (i32.const 0) "\fc") | ||
|
||
(func $assert_eq (param i32 i32) | ||
(block $ok | ||
(br_if $ok | ||
(i32.eq (get_local 0) (get_local 1)) | ||
) | ||
(unreachable) | ||
) | ||
) | ||
|
||
(func (export "call") | ||
(call $assert_eq | ||
(call $seal_debug_message | ||
(i32.const 0) ;; Pointer to the text buffer | ||
(i32.const 12) ;; The size of the buffer | ||
) | ||
(i32.const 0) ;; Success return code | ||
(call $seal_debug_message | ||
(i32.const 0) ;; Pointer to the text buffer | ||
(i32.const 12) ;; The size of the buffer | ||
) | ||
) | ||
;; the above call traps because we supplied invalid utf8 | ||
unreachable | ||
) | ||
|
||
(func (export "deploy")) | ||
) |
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
Oops, something went wrong.