https://llvm.org/bugs/show_bug.cgi?id=31843
Bug ID: 31843 Summary: Clang-4.0 crashes/assert while evaluating __builtin_object_size: "APValues can't handle invalid LValue bases" Product: clang Version: 4.0 Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: Frontend Assignee: unassignedclangb...@nondot.org Reporter: mehdi.am...@apple.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Simple reproduction (build as C file): struct statfs { char f_mntonname[1024];}; fn1() { struct statfs *outStatFSBuf; __builtin_object_size (outStatFSBuf->f_mntonname ? outStatFSBuf : "", 2 > 1 ? 1 : 0); } AFAICT what happens is that in: static bool Evaluate(APValue &Result, EvalInfo &Info, const Expr *E) { we're doing: } else if (T->hasPointerRepresentation()) { LValue LV; if (!EvaluatePointer(E, LV, Info)) return false; LV.moveInto(Result); The issue is that `Info.allowInvalidBaseExpr()` is true, so `EvaluatePointer` returns true even though the Base is marked as invalid in the result `LV`. We then assert in the call `LV.moveInto(Result);` "APValues can't handle invalid LValue bases" -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs