Просмотр исходного кода

Lua : fix situations where a generated value is itself an opassign

Justin Donaldson 10 лет назад
Родитель
Сommit
79bccba40e
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      genlua.ml

+ 6 - 0
genlua.ml

@@ -901,6 +901,12 @@ and gen_value ctx e =
 		)
 	in
 	match e.eexpr with
+	| TBinop (OpAssign, e1, e2) ->
+		spr ctx "(function() ";
+		gen_expr ctx e;
+		spr ctx " return ";
+		gen_value ctx e1;
+		spr ctx " end)()";
 	| TConst _
 	| TLocal _
 	| TArray _