http://llvm.org/bugs/show_bug.cgi?id=14965
Bug #: 14965
Summary: Better error message for GEP with partially defined
contents
Product: new-bugs
Version: unspecified
Platform: PC
OS/Version: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
When trying to verify this IR:
%array$str = type { i64, [0 x %str] }
declare i8* @malloc(i64)
define i64 @foo(i64 %objsz) {
%array.raw = call i8* @malloc(i64 %objsz);
%array = bitcast i8* %array.raw to %array$str*
%array.data = getelementptr %array$str* %array, i32 0, i32 1
%ret = ptrtoint [0 x %str]* %array.data to i64
ret i64 %ret
}
%str = type {i8*, i64}
It fails like this:
test.ll:50:30: error: invalid getelementptr indices
%array.data = getelementptr %array$str* %array, i32 0, i32 1
^
1 error generated.
This appears to be due to %str being undefined where %array$str is defined. It
would be nice if this was reported with a better error message. It seems to me
that it could even be reported when processing the %array$str definition, but
there might be some subtleties that make that impossible.
--
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