Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Commit 373f655

Browse files
authored
Merge pull request #319 from paritytech/at-fix-threads
Fix threads proposal parsing
2 parents c69f8a2 + a38e184 commit 373f655

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/elements/ops.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,14 @@ fn deserialize_atomic<R: io::Read>(reader: &mut R) -> Result<Instruction, Error>
14341434
I64_ATOMIC_RMW_SUB16U => I64AtomicRmwSub16u(mem),
14351435
I64_ATOMIC_RMW_SUB32U => I64AtomicRmwSub32u(mem),
14361436

1437+
I32_ATOMIC_RMW_AND => I32AtomicRmwAnd(mem),
1438+
I64_ATOMIC_RMW_AND => I64AtomicRmwAnd(mem),
1439+
I32_ATOMIC_RMW_AND8U => I32AtomicRmwAnd8u(mem),
1440+
I32_ATOMIC_RMW_AND16U => I32AtomicRmwAnd16u(mem),
1441+
I64_ATOMIC_RMW_AND8U => I64AtomicRmwAnd8u(mem),
1442+
I64_ATOMIC_RMW_AND16U => I64AtomicRmwAnd16u(mem),
1443+
I64_ATOMIC_RMW_AND32U => I64AtomicRmwAnd32u(mem),
1444+
14371445
I32_ATOMIC_RMW_OR => I32AtomicRmwOr(mem),
14381446
I64_ATOMIC_RMW_OR => I64AtomicRmwOr(mem),
14391447
I32_ATOMIC_RMW_OR8U => I32AtomicRmwOr8u(mem),

testsuite/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ fn basic(path: &str) {
2121
run::check(path);
2222
}
2323
}
24+
25+
#[test_generator::test_resources("testsuite/spec/proposals/threads/*.wast")]
26+
fn threads(path: &str) {
27+
run::check(path);
28+
}

testsuite/src/run.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn check(path: &str) {
1313
match kind {
1414
WastDirective::Module(mut module) => {
1515
let (line, _col) = module.span.linecol_in(&source);
16-
println!("Parsing module at line {}", line);
16+
println!("Parsing module at line {}", line + 1);
1717
let orig_bytes = module.encode().unwrap();
1818
let parsed =
1919
deserialize_buffer::<Module>(&orig_bytes).expect("Failed to parse module");
@@ -25,7 +25,7 @@ pub fn check(path: &str) {
2525
span,
2626
} => {
2727
let (line, _col) = span.linecol_in(&source);
28-
println!("Parsing assert_malformed at line {}", line);
28+
println!("Parsing assert_malformed at line {}", line + 1);
2929
let parsed = deserialize_buffer::<Module>(&module.encode().unwrap());
3030
if parsed.is_ok() {
3131
panic!("Module should be malformed because: {}", message);

0 commit comments

Comments
 (0)