[llvm-dev] Assertion error in APInt.cpp

Roman Lebedev via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 9 11:32:41 PST 2019

On Wed, Jan 9, 2019 at 10:27 PM Alberto Barbaro via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Hi all,
> I'm experimenting with the Interpreter and all look good so far :) Unfortunately when I play with the visitBinartOperator() method I have the following assertion error:
> Support/APInt.cpp:233: llvm::APInt llvm::APInt::operator*(const llvm::APInt &) const: Assertion `BitWidth == RHS.BitWidth && "Bit widths must be the same"' failed.
> I have recompiled llvm and printer the 2 widths. BitWidth is 1 and RHS.BitWidth is 32.
> I would clarify that in the visitBinaryOperator() I just call Interpreter::visitBinaryOperator(I) and I do not perform any other operation.
> Can you imagine any reason why this error happens? I have attached the file I used for having the error.

I would guess because
> BitWidth is 1 and RHS.BitWidth is 32.
which is what it said in the assertion message.
It is up to the API user to uphold that requirement.

> Thanks

> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

More information about the llvm-dev mailing list