view rathaxes_compiler_passes_fix_placeholder_identification.patch @ 142:cbff597d307e default tip

Wip doc
author Louis Opter <louis@lse.epita.fr>
date Sun, 09 Feb 2014 15:48:57 -0800
parents 2a7126613c70
children
line wrap: on
line source

# 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