http://llvm.org/bugs/show_bug.cgi?id=10552
Summary: Struct Allocation / Return Bug
Product: dragonegg
Version: 2.7
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: New Bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Consider the following short program:
struct S1 {
unsigned char f0;
volatile unsigned short f1;
short f2;
};
struct S1 func_9(unsigned short a)
{
struct S1 b;
b.f0 = 1;
b.f1 = a;
b.f2 = -4;
return b;
}
int main (void)
{
struct S1 k = func_9(5);
printf("f0 = %d\n", k.f0);
}
In func_9 compiled with dragonegg 2.7,
5 bytes are allocated for struct S1 b (%memtmp2) with the instruction:
%memtmp2 = alloca %"struct S1"
Yet, 8 bytes are accessed when it is being returned:
%retval = load i64* %22
ret i64 %retval
In some interpreters like klee, this causes a crash.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs