[llvm-bugs] [Bug 35267] New: clang asserts when total size of static variables exceeds the address space

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 9 12:28:45 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35267

            Bug ID: 35267
           Summary: clang asserts when total size of static variables
                    exceeds the address space
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ch3root at openwall.com
                CC: llvm-bugs at lists.llvm.org

Source code:

----------------------------------------------------------------------
int main(void)
{
  static char a[-1u / 2];
  static char b[-1u / 2];
  static char c[3];

  a[0] = 1;
  b[0] = 1;
  c[2] = 1;
}
----------------------------------------------------------------------

Results:

----------------------------------------------------------------------
$ clang -std=c11 -m32 test.c
clang-6.0:
/path/to/clang/sources/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp:123:
virtual void {anonymous}::X86AsmBackend::applyFixup(const llvm::MCAssembler&,
const llvm::MCFixup&, const llvm::MCValue&, llvm::MutableArrayRef<char>,
uint64_t, bool) const: Assertion `isIntN(Size * 8 + 1, Value) && "Value does
not fit in the Fixup field"' failed.
[etc.]
----------------------------------------------------------------------

clang x86-64 version: clang version 6.0.0 (trunk 317827)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171109/7a9d76d9/attachment.html>


More information about the llvm-bugs mailing list