Commit 3dd703a5 authored by Alastair Robertson's avatar Alastair Robertson

Fix string propagation

e.g. @x = "a"; @y = @x;
parent 0fe71da4
......@@ -109,7 +109,7 @@ CallInst *IRBuilderBPF::CreateBpfPseudoCall(Map &map)
return CreateBpfPseudoCall(mapfd);
}
LoadInst *IRBuilderBPF::CreateMapLookupElem(Map &map, AllocaInst *key)
Value *IRBuilderBPF::CreateMapLookupElem(Map &map, AllocaInst *key)
{
Value *map_ptr = CreateBpfPseudoCall(map);
......@@ -146,6 +146,9 @@ LoadInst *IRBuilderBPF::CreateMapLookupElem(Map &map, AllocaInst *key)
CreateStore(getInt64(0), value);
CreateBr(lookup_merge_block);
SetInsertPoint(lookup_merge_block);
if (map.type.type == Type::string)
return value;
return CreateLoad(value);
}
......
......@@ -25,7 +25,7 @@ public:
void CreateMemset(Value *dst, Value *val, size_t len);
CallInst *CreateBpfPseudoCall(int mapfd);
CallInst *CreateBpfPseudoCall(Map &map);
LoadInst *CreateMapLookupElem(Map &map, AllocaInst *key);
Value *CreateMapLookupElem(Map &map, AllocaInst *key);
void CreateMapUpdateElem(Map &map, AllocaInst *key, Value *val);
void CreateMapDeleteElem(Map &map, AllocaInst *key);
void CreateProbeRead(AllocaInst *dst, size_t size, Value *src);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment