- var closdef = d._closures[closure_decl]
- if closdef == null then
- # Default is already guarded and inlined
- return
- end
- # Break sequence cannot be inlined :/
- assert break_seq == null
- var res = d._icb.inline_routine(closdef, d.dup_iregs(exprs), null)
- if result != null then
- assert res != null
- d._icb.stmt(new IMove(d.dup_ireg(result.as(not null)), res))
+ if d._closures.has_key(closure_decl) then
+ # The icloscall need to be replaced with an inlined closdef
+ var closdef = d._closures[closure_decl]
+ if closdef == null then
+ # Default is already guarded and inlined
+ return
+ end
+ # Break sequence cannot be inlined :/
+ assert break_seq == null
+ # Inline the closdef
+ var res = d._icb.inline_routine(closdef, d.dup_iregs(exprs), null)
+ if result != null then
+ assert res != null
+ d._icb.stmt(new IMove(d.dup_ireg(result.as(not null)), res))
+ end
+ else
+ # Standard icloscall duplication
+ super