From b64d4e714979964b099e46c9eda38223b53feaa8 Mon Sep 17 00:00:00 2001 From: Mark Shinwell Date: Wed, 25 Jan 2017 11:46:27 +0000 Subject: [PATCH] Don't inline stubs in Closure (fixes error in GPR#957) (#1008) --- asmcomp/closure.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/asmcomp/closure.ml b/asmcomp/closure.ml index ecb9feefc..9917ed4ae 100644 --- a/asmcomp/closure.ml +++ b/asmcomp/closure.ml @@ -1106,9 +1106,9 @@ and close_functions fenv cenv fun_defs = ) fun_defs) in - let inline_attribute, stub = match fun_defs with - | [_, Lfunction{attr = { inline; stub }}] -> inline, stub - | _ -> Default_inline, false (* recursive functions can't be inlined *) + let inline_attribute = match fun_defs with + | [_, Lfunction{attr = { inline; }}] -> inline + | _ -> Default_inline (* recursive functions can't be inlined *) in (* Update and check nesting depth *) incr function_nesting_depth; @@ -1197,7 +1197,7 @@ and close_functions fenv cenv fun_defs = | Never_inline -> min_int | Unroll _ -> assert false in - if stub || lambda_smaller ubody threshold + if lambda_smaller ubody threshold then fundesc.fun_inline <- Some(fun_params, ubody); (f, (id, env_pos, Value_closure(fundesc, approx))) in