diff rathaxes_compiler_passes_fix_placeholder_identification.patch @ 116:2a7126613c70

WIP, add the patch from David to fix cast expansion
author Louis Opter <louis@lse.epita.fr>
date Mon, 22 Jul 2013 16:04:12 -0700
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rathaxes_compiler_passes_fix_placeholder_identification.patch	Mon Jul 22 16:04:12 2013 -0700
@@ -0,0 +1,21 @@
+# HG changeset patch
+# User David Pineau <dav.pineau@gmail.com>
+# Parent 8ffd7987f711493f9c87e029ba0977f5126e6120
+rathaxes: fix a misuse of the unknown list in the placeholder identification pass
+
+Fixes "unknown" C types being incorrectly expanded to numbers.
+
+diff --git a/rathaxes/compiler/passes/back/rtxPlaceHolders.inc.cws b/rathaxes/compiler/passes/back/rtxPlaceHolders.inc.cws
+--- a/rathaxes/compiler/passes/back/rtxPlaceHolders.inc.cws
++++ b/rathaxes/compiler/passes/back/rtxPlaceHolders.inc.cws
+@@ -194,7 +194,9 @@
+                 // in unstrict mode
+                 if (existVariable(ctype_ref.unknown) && $getArraySize(ctype_ref.unknown) > 0$)
+                 {       
+-                    ctype_ref.identifier = ctype_ref.unknown#back;
++                    local it;
++                    createReverseIterator(it, ctype_ref.unknown);
++                    ctype_ref.identifier = key(it);
+                     removeVariable(ctype_ref.unknown);
+                 }
+                 // name of a type