Skip to content

Commit

Permalink
fix #42590, long attribute loop compiling cfunction (#42635)
Browse files Browse the repository at this point in the history
(cherry picked from commit 687b1e0)
  • Loading branch information
JeffBezanson authored and KristofferC committed Nov 11, 2021
1 parent 1d03f3e commit 1e4966c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4853,9 +4853,11 @@ static Function* gen_cfun_wrapper(
newAttributes.emplace_back(it, AttributeSet::get(jl_LLVMContext, attrBuilder));

// Shift forward the rest of the attributes
for(;it < attributes.index_end(); ++it) {
if (attributes.hasAttributes(it)) {
newAttributes.emplace_back(it + 1, attributes.getAttributes(it));
if (attributes.getNumAttrSets() > 0) { // without this check the loop range below is invalid
for(;it < attributes.index_end(); ++it) {
if (attributes.hasAttributes(it)) {
newAttributes.emplace_back(it + 1, attributes.getAttributes(it));
}
}
}

Expand Down

0 comments on commit 1e4966c

Please sign in to comment.