Mercurial > archived > louis > epitech > mq > rathaxes
view wip_debug.patch @ 128:0fdaa93ed62b
Start to clean up new compiler patch
author | Louis Opter <louis@lse.epita.fr> |
---|---|
date | Mon, 26 Aug 2013 22:53:34 -0700 |
parents | 72b5b4a62cc5 |
children |
line wrap: on
line source
# HG changeset patch # Parent ea807d6831821c5fb094e7ae9258f5a282ec15e6 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 @@ -729,9 +729,17 @@ // First, try to retrieve value from previous resVals, otherwise build it from chunk if (varName != "self") { + // + // XXX Note: Here, we may encounter some issues if the chunk's type_map isnt properly filled + // (encountered once, the type was scalar instead of ref) + // + local self_reftype = "scalar"; + local self_rtype; if (rtxNodeArgs_GetArgByName(resolverValues, varName, self) == true) { rtxNodeArg_getValue(self, self_value); + rtxNodeArg_getRType(self, self_rtype); + self_reftype = self_rtype.qualifier; } else { @@ -740,8 +748,10 @@ clearVariable(self_value); cnormNode_TerminalId(self_value, varName); } - rtxNodeArgs_AppendArg(resVal, "self", theChunk.type_map[varName], self_value); - setall self_type = theChunk.type_map[varName]; + setall self_rtype = theChunk.type_map[varName]; + self_rtype.qualifier = self_reftype; + rtxNodeArgs_AppendArg(resVal, "self", self_rtype, self_value); + setall self_type = self_rtype; } else {