Commit d933a639 authored by Brendan Gregg's avatar Brendan Gregg

fix for #18: initializing comm memory

parent ac109604
......@@ -69,6 +69,8 @@ void CodegenLLVM::visit(Builtin &builtin)
else if (builtin.ident == "comm")
{
AllocaInst *buf = b_.CreateAllocaBPF(builtin.type, "comm");
// initializing memory needed for older kernels:
b_.CreateMemSet(buf, b_.getInt8(0), builtin.type.size, 1);
b_.CreateGetCurrentComm(buf, builtin.type.size);
expr_ = buf;
}
......
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