Browse Source

bugfix in stack handling

Nicolas Cannasse 17 years ago
parent
commit
91d02e0191
2 changed files with 6 additions and 0 deletions
  1. 1 0
      doc/CHANGES.txt
  2. 5 0
      transform.ml

+ 1 - 0
doc/CHANGES.txt

@@ -31,6 +31,7 @@ TODO inlining : substitute class+function type parameters in order to have fully
 	removed neko.Int32
 	removed neko.io.Input/Output/Eof/Error/Logger/Multiple/StringInput/StringOutput
 	changed neko apis to use haxe.io and Bytes instead of String buffers
+	fixed big bug in js/flash8 debug stack handling
 
 2008-04-05: 1.19
 	fixed flash9 Array.toString

+ 5 - 0
transform.ml

@@ -286,6 +286,11 @@ let stack_block ?(useadd=false) ctx e =
 		match e.eexpr with
 		| TFunction _ ->
 			e
+		| TReturn None | TReturn (Some { eexpr = TConst _ }) | TReturn (Some { eexpr = TLocal _ }) ->
+			mk (TBlock [
+				stack_pop;
+				e;
+			]) e.etype e.epos
 		| TReturn (Some e) ->
 			mk (TBlock [
 				mk (TVars ["$tmp", t_dynamic, Some (loop e)]) t_dynamic e.epos;