Browse Source

neko bugfix when single var in a switch case

Nicolas Cannasse 14 years ago
parent
commit
44e693bb1f
1 changed files with 2 additions and 0 deletions
  1. 2 0
      optimizer.ml

+ 2 - 0
optimizer.ml

@@ -461,6 +461,8 @@ let sanitize_expr e =
 		{ e with eexpr = TTry (e1,catches) }
 		{ e with eexpr = TTry (e1,catches) }
 	| TSwitch (e1,cases,def) ->
 	| TSwitch (e1,cases,def) ->
 		let e1 = parent e1 in
 		let e1 = parent e1 in
+		let cases = List.map (fun (el,e) -> el, complex e) cases in
+		let def = (match def with None -> None | Some e -> Some (complex e)) in
 		{ e with eexpr = TSwitch (e1,cases,def) }
 		{ e with eexpr = TSwitch (e1,cases,def) }
 	| _ ->
 	| _ ->
 		e
 		e