mirror of
https://github.com/fluencelabs/wasmer
synced 2025-07-01 09:31:32 +00:00
Add TBAA labels to initialization (default and copy) of locals.
This commit is contained in:
@ -927,7 +927,14 @@ impl<'ctx> FunctionCodeGenerator<CodegenError> for LLVMFunctionCodeGenerator<'ct
|
|||||||
for local_idx in 0..count {
|
for local_idx in 0..count {
|
||||||
let alloca =
|
let alloca =
|
||||||
alloca_builder.build_alloca(ty, &format!("local{}", param_len + local_idx));
|
alloca_builder.build_alloca(ty, &format!("local{}", param_len + local_idx));
|
||||||
builder.build_store(alloca, default_value);
|
let store = builder.build_store(alloca, default_value);
|
||||||
|
tbaa_label(
|
||||||
|
&self.module,
|
||||||
|
&intrinsics,
|
||||||
|
"local",
|
||||||
|
store,
|
||||||
|
Some((param_len + local_idx) as u32),
|
||||||
|
);
|
||||||
if local_idx == 0 {
|
if local_idx == 0 {
|
||||||
alloca_builder.position_before(
|
alloca_builder.position_before(
|
||||||
&alloca
|
&alloca
|
||||||
@ -8579,10 +8586,17 @@ impl<'ctx> ModuleCodeGenerator<LLVMFunctionCodeGenerator<'ctx>, LLVMBackend, Cod
|
|||||||
let real_ty_llvm = type_to_llvm(&intrinsics, real_ty);
|
let real_ty_llvm = type_to_llvm(&intrinsics, real_ty);
|
||||||
let alloca =
|
let alloca =
|
||||||
alloca_builder.build_alloca(real_ty_llvm, &format!("local{}", index));
|
alloca_builder.build_alloca(real_ty_llvm, &format!("local{}", index));
|
||||||
builder.build_store(
|
let store = builder.build_store(
|
||||||
alloca,
|
alloca,
|
||||||
builder.build_bitcast(param, real_ty_llvm, &state.var_name()),
|
builder.build_bitcast(param, real_ty_llvm, &state.var_name()),
|
||||||
);
|
);
|
||||||
|
tbaa_label(
|
||||||
|
&self.module,
|
||||||
|
&intrinsics,
|
||||||
|
"local",
|
||||||
|
store,
|
||||||
|
Some(index as u32),
|
||||||
|
);
|
||||||
if index == 0 {
|
if index == 0 {
|
||||||
alloca_builder.position_before(
|
alloca_builder.position_before(
|
||||||
&alloca
|
&alloca
|
||||||
|
Reference in New Issue
Block a user