Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into esdrubal/418
Browse files Browse the repository at this point in the history
IGI-111 authored Jul 2, 2024
2 parents f856463 + b323844 commit dc594d8
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sway-core/src/asm_lang/virtual_ops.rs
Original file line number Diff line number Diff line change
@@ -577,7 +577,7 @@ impl VirtualOp {
WQML(r1, r2, r3, _) => vec![r1, r2, r3],
WQDV(r1, r2, r3, _) => vec![r1, r2, r3],
WQCM(_, r2, r3, _) => vec![r2, r3],
WQAM(_, r2, r3, r4) => vec![r2, r3, r4],
WQAM(r1, r2, r3, r4) => vec![r1, r2, r3, r4],

/* Control Flow Instructions */
JMP(r1) => vec![r1],
@@ -694,7 +694,7 @@ impl VirtualOp {
WQML(_, _, _, _) => vec![],
WQDV(_, _, _, _) => vec![],
WQCM(r1, _, _, _) => vec![r1],
WQAM(r1, _, _, _) => vec![r1],
WQAM(_, _, _, _) => vec![],

/* Control Flow Instructions */
JMP(_r1) => vec![],
Original file line number Diff line number Diff line change
@@ -175,4 +175,10 @@ fn type_inference_numeric_2() -> u256 {
let mut result = 0;
result = 3.as_u256();
result
}
}

#[test]
fn incorrect_def_modeling() -> u256 {
let c: u256 = 1;
c % c // this emits a WQAM instruction
}

0 comments on commit dc594d8

Please sign in to comment.