Introduce tests which demonstrate bad wasm compiler.

This commit is contained in:
Gav
2018-01-26 19:26:10 +01:00
parent bbac6f8da1
commit 0b138b0fd5
12 changed files with 96 additions and 30 deletions
+7 -1
View File
@@ -144,7 +144,13 @@ macro_rules! impl_stubs {
};
let output = super::$name(&input[..]);
&output[0] as *const u8 as u64 + ((output.len() as u64) << 32)
// things break if we try to take the address of an unallocated vec, so we
// shortcircuit the empty output case.
if output.len() > 0 {
&output[0] as *const u8 as u64 + ((output.len() as u64) << 32)
} else {
0
}
}
)*
}