We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
cfunction
1 parent fa6f4f0 commit 01c9f54Copy full SHA for 01c9f54
src/codegen.cpp
@@ -4853,9 +4853,11 @@ static Function* gen_cfun_wrapper(
4853
newAttributes.emplace_back(it, AttributeSet::get(jl_LLVMContext, attrBuilder));
4854
4855
// Shift forward the rest of the attributes
4856
- for(;it < attributes.index_end(); ++it) {
4857
- if (attributes.hasAttributes(it)) {
4858
- 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)) {
4859
+ newAttributes.emplace_back(it + 1, attributes.getAttributes(it));
4860
+ }
4861
}
4862
4863
0 commit comments