Skip to content

Commit 5932283

Browse files
committed
Remove workaround for UB in cranelift-jit that has been fixed
1 parent e2cc8eb commit 5932283

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/constant.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
388388
}
389389

390390
let bytes = alloc.inspect_with_uninit_and_ptr_outside_interpreter(0..alloc.len()).to_vec();
391-
if bytes.is_empty() {
392-
// FIXME(bytecodealliance/wasmtime#7918) cranelift-jit has a bug where it causes UB on
393-
// empty data objects
394-
data.define(Box::new([0]));
395-
} else {
396-
data.define(bytes.into_boxed_slice());
397-
}
391+
data.define(bytes.into_boxed_slice());
398392

399393
for &(offset, prov) in alloc.provenance().ptrs().iter() {
400394
let alloc_id = prov.alloc_id();

0 commit comments

Comments
 (0)