Ignore:
Timestamp:
Dec 6, 2017, 5:41:27 PM (18 months ago)
Author:
nmedfort
Message:

Bug fixes + more assertions to prevent similar errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IR_Gen/CBuilder.cpp

    r5755 r5757  
    967967
    968968void CBuilder::__CreateAssert(Value * const assertion, StringRef failureMessage) {
    969     if (LLVM_UNLIKELY(codegen::DebugOptionIsSet(codegen::EnableAsserts))) {
     969    if (LLVM_UNLIKELY(isa<Constant>(assertion))) {
     970        if (LLVM_UNLIKELY(cast<Constant>(assertion)->isNullValue())) {
     971            report_fatal_error(failureMessage);
     972        }
     973    } else if (LLVM_UNLIKELY(codegen::DebugOptionIsSet(codegen::EnableAsserts))) {
    970974        Module * const m = getModule();
    971         if (LLVM_UNLIKELY(isa<ConstantInt>(assertion))) {
    972             if (LLVM_UNLIKELY(cast<ConstantInt>(assertion)->isZero())) {
    973                 report_fatal_error(failureMessage);
    974             } else {
    975                 return;
    976             }
    977         }
    978975        Type * const stackTy = TypeBuilder<uintptr_t, false>::get(getContext());
    979976        PointerType * const stackPtrTy = stackTy->getPointerTo();
Note: See TracChangeset for help on using the changeset viewer.