[AbstractCallSite][FIX] Correct faulty assertion

When the Attributor run on the IPConstantProp test case for multiple
callbacks it triggered a faulty assertion in the AbstractCallSite
implementation. The callee can well be at argument position 0.
This commit is contained in:
Johannes Doerfert 2019-11-01 23:32:17 -05:00
parent 83503ad119
commit 4c56086f8b
2 changed files with 2 additions and 1 deletions

View File

@ -850,7 +850,7 @@ public:
/// callee of this ACS. Only valid for callback calls!
int getCallArgOperandNoForCallee() const {
assert(isCallbackCall());
assert(CI.ParameterEncoding.size() && CI.ParameterEncoding[0] > 0);
assert(CI.ParameterEncoding.size() && CI.ParameterEncoding[0] >= 0);
return CI.ParameterEncoding[0];
}

View File

@ -1,4 +1,5 @@
; RUN: opt -ipconstprop -S < %s | FileCheck %s
; RUN: opt -S -passes=attributor -aa-pipeline='basic-aa' -attributor-disable=false -attributor-max-iterations-verify -attributor-max-iterations=1 < %s | FileCheck %s
;
;
; /---------------------------------------|