Open elliottt opened 9 months ago
Using wrapping_offset it also an option. On CHERI you would need to use the current code to preserve the pointer capability I think, but we don't support CHERI yet anyway.
Hi, @elliottt @bjorn3,is this issue is still actual? Unfortunately from glaziermag's pr and this comment (https://github.com/bytecodealliance/wasmtime/pull/8041#discussion_r1509922915) i cannot understand, whether pr is not correct, or bjorn3 decided that any modification(about this issue) doesn't make sense at all
When performing relocations in cranelift-jit, there are many introductions of a variable
what
that's defined as an unsafe pointer offset. These variables are almost always cast tousize
orisize
before they're used, so perhaps we should instead turn the base pointer into its target numeric type eagerly, to avoid needing theunsafe
blocks for calling theoffset
method on the pointers.https://github.com/bytecodealliance/wasmtime/blob/cd97c9f14713d81de5453fb9861319e78a761432/cranelift/jit/src/compiled_blob.rs#L55-L57