forked from MystenLabs/sui
-
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.
[bug fix] Fix missing return in id_leak_verifier (MystenLabs#6526)
- Fixed missing return - Added another test
- Loading branch information
Showing
6 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
crates/sui-verifier-transactional-tests/tests/id_leak/direct_leak_through_call.exp
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,5 +1,5 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 4-25: | ||
created: object(103) | ||
written: object(102) | ||
Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: UNKNOWN_VERIFICATION_ERROR, sub_status: None, message: Some("Sui Move Bytecode Verification Error: ID leaked through function call."), exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m") }), indices: [], offsets: [] }) } } |
10 changes: 7 additions & 3 deletions
10
crates/sui-verifier-transactional-tests/tests/id_leak/indirect_leak_through_call.exp
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,5 +1,9 @@ | ||
processed 1 task | ||
processed 2 tasks | ||
|
||
task 0 'publish'. lines 4-25: | ||
created: object(103) | ||
written: object(102) | ||
Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: UNKNOWN_VERIFICATION_ERROR, sub_status: None, message: Some("Sui Move Bytecode Verification Error: ID leaked through function call."), exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m") }), indices: [], offsets: [] }) } } | ||
|
||
task 1 'publish'. lines 27-48: | ||
Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: UNKNOWN_VERIFICATION_ERROR, sub_status: None, message: Some("Sui Move Bytecode Verification Error: ID leaked through function call."), exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m") }), indices: [], offsets: [] }) } } |
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
5 changes: 5 additions & 0 deletions
5
crates/sui-verifier-transactional-tests/tests/id_leak/transmute.exp
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,5 @@ | ||
processed 1 task | ||
|
||
task 0 'publish'. lines 4-28: | ||
Error: Transaction Effects Status: Move Bytecode Verification Error. Please run the Bytecode Verifier for more information. | ||
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: VMVerificationOrDeserializationError, source: Some(VMError { major_status: UNKNOWN_VERIFICATION_ERROR, sub_status: None, message: Some("Sui Move Bytecode Verification Error: ID leaked through function call."), exec_state: None, location: Module(ModuleId { address: _, name: Identifier("m") }), indices: [], offsets: [] }) } } |
28 changes: 28 additions & 0 deletions
28
crates/sui-verifier-transactional-tests/tests/id_leak/transmute.mvir
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,28 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# publish | ||
module 0x0.m { | ||
import 0x2.object; | ||
import 0x2.tx_context; | ||
import 0x2.transfer; | ||
|
||
struct Cat has key { | ||
id: object.UID, | ||
} | ||
|
||
struct Dog has key { | ||
id: object.UID, | ||
} | ||
|
||
public entry transmute(cat: Self.Cat, ctx: &mut tx_context.TxContext) { | ||
let cat_id: object.UID; | ||
let dog: Self.Dog; | ||
label l0: | ||
Cat { id: cat_id } = move(cat); | ||
dog = Dog { id: move(cat_id) }; | ||
transfer.transfer<Self.Dog>(move(dog), tx_context.sender(freeze(copy(ctx)))); | ||
return; | ||
} | ||
|
||
} |
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