2
0
Эх сурвалжийг харах

fixed bug in macro context cache reuse (had wrong ctx) (close #2566)

Nicolas Cannasse 10 жил өмнө
parent
commit
37285ba42d
2 өөрчлөгдсөн 4 нэмэгдсэн , 3 устгасан
  1. 3 2
      interp.ml
  2. 1 1
      typer.ml

+ 3 - 2
interp.ml

@@ -3573,8 +3573,9 @@ let create com api =
 
 
 
-let do_reuse ctx =
-	ctx.is_reused <- false
+let do_reuse ctx api =
+	ctx.is_reused <- false;
+	ctx.curapi <- api
 
 let can_reuse ctx types =
 	let has_old_version t =

+ 1 - 1
typer.ml

@@ -4518,7 +4518,7 @@ let create_macro_interp ctx mctx =
 			let mint = Interp.create com2 (make_macro_api ctx Ast.null_pos) in
 			mint, (fun() -> init_macro_interp ctx mctx mint)
 		| Some mint ->
-			Interp.do_reuse mint;
+			Interp.do_reuse mint (make_macro_api ctx Ast.null_pos);
 			mint, (fun() -> ())
 	) in
 	let on_error = com2.error in