mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-28 08:01:33 +00:00
Merge #1096
1096: Add TBAA labels to initialization (default and copy) of locals. r=nlewycky a=nlewycky Co-authored-by: Nick Lewycky <nick@wasmer.io>
This commit is contained in:
@ -1019,7 +1019,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
|
||||||
@ -8775,10 +8782,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