repl_test: update build.rs to work with Zig 0.9 (like test_gen)

This commit is contained in:
Brian Carroll 2022-04-11 14:19:56 +01:00
parent 249925cb23
commit a663d335fc
3 changed files with 91 additions and 27 deletions

View file

@ -115,7 +115,7 @@ fn section_size(bytes: &[u8]) -> usize {
}
fn parse_section<'a>(id: SectionId, module_bytes: &'a [u8], cursor: &mut usize) -> (u32, &'a [u8]) {
if module_bytes[*cursor] != id as u8 {
if (*cursor >= module_bytes.len()) || (module_bytes[*cursor] != id as u8) {
return (0, &[]);
}
*cursor += 1;

View file

@ -39,13 +39,13 @@ fn build_wasm() {
&platform_path,
&compiler_rt_path,
"-L",
&libc_dir,
libc_dir,
"-lc",
"-o",
&format!("{}/{}.o", out_dir, PLATFORM_FILENAME),
"--export-all",
"--no-entry",
// "--emit-relocs", // TODO: resize stack by relocating __heap_base (issue #2480)
// "--emit-relocs", // TODO: resize stack by relocating __heap_base (issue #2480) here and in repl_test build
];
let zig = zig_executable();