Mercurial > archived > louis > epitech > mq > rathaxes
view rathaxes_compiler_passes_fix_reference_reuse.patch @ 130:6359457dce75
wip
author | Louis Opter <louis@lse.epita.fr> |
---|---|
date | Sun, 01 Dec 2013 17:39:26 -0800 |
parents | ecba077e0f73 |
children |
line wrap: on
line source
# HG changeset patch # User David Pineau <dav.pineau@gmail.com>, Louis Opter <louis@lse.epita.fr> # Parent 732233e9a7ba6638d5c75ed277fce8d6de626601 rathaxes: fix an issue raised by re-using a reference to the ResVals Fixes incorrectly generated rathaxes variable expansion. diff --git a/rathaxes/compiler/passes/common/rtxResolve.inc.cws b/rathaxes/compiler/passes/common/rtxResolve.inc.cws --- a/rathaxes/compiler/passes/common/rtxResolve.inc.cws +++ b/rathaxes/compiler/passes/common/rtxResolve.inc.cws @@ -340,6 +340,7 @@ if (existVariable(dst_p.identifiers)) ref param_name = dst_p.identifiers#front.name; local param_type; + local param_src_value; local param_value; local src_arg; @@ -375,9 +376,10 @@ if (rtxNodeArg_getRType(src_arg, param_type) == false) return false; setall resolver_type = param_type; - if (rtxNodeArg_getValue(src_arg, param_value) == false) + if (rtxNodeArg_getValue(src_arg, param_src_value) == false) return false; + setall param_value = param_src_value; // In case a recursive resolution is necessary, we need to setup a "self" rtxNodeArgs_AppendArg(subResVal, "self", resolver_type, param_value); } @@ -443,6 +445,7 @@ local src_arg; local src_name = param_value.id; if (rtxNodeArgs_GetArgByName(src_resVals, src_name, src_arg)) + return false; if (rtxNodeArg_getRType(src_arg, param_type) == false) return false; if (rtxNodeArg_getValue(src_arg, param_value) == false)