CTSRD-CHERI / clang

DO NOT USE. Use llvm-project instead
Other
9 stars 8 forks source link

Assertion failure in qtbase #176

Closed khilangudka closed 6 years ago

khilangudka commented 6 years ago

I get the following assertion failure:

Assertion failed: (Offset.getBitWidth() == DL.getPointerBaseSizeInBits(getPointerAddressSpace()) && "The offset must have exactly as many bits as our pointer."), function accumulateConst    antOffset, file /home/kg365/workspace/cheri/cheri-build/llvm/lib/IR/Operator.cpp, line 39.

Reduced test case:

// RUN: %cheri_purecap_cc1 -emit-obj -target-cpu mips4 -cheri-size 256 -Os -std=c++1z -fdeprecated-macro -fvisibility hidden -fvisibility-inlines-hidden -pthread -vectorize-loops -vectorize-slp -o -  %s
class a {
public:
  a(float);
  float b, c, e, d;
};
a operator*(a &h, float) { return h.d; }
inline a operator-(a) {}
float f;
void g(a h) {
  a i(h);
  -i = i * f;
}

Full reproducer: https://gist.github.com/kgudka/ec70fc06fc9ff567c0be6ea7e9d4acc5

arichardson commented 6 years ago

Duplicate of #175