From e7b69d9ea4e0a7088c9d12aed573728e08af1ec0 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Mon, 17 Sep 2018 10:44:38 -0700 Subject: [PATCH] Jit: ensure objp properly updated by SpillRetExprHelper (#19974) We need to arrange to actually update the call objp in the SpillRetExprHelper, otherwise the changes don't propagate back into the tree. --- src/jit/importer.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp index 5a86ff9..43fa848 100644 --- a/src/jit/importer.cpp +++ b/src/jit/importer.cpp @@ -19890,7 +19890,7 @@ CORINFO_RESOLVED_TOKEN* Compiler::impAllocateToken(CORINFO_RESOLVED_TOKEN token) } //------------------------------------------------------------------------ -// SpillRetExprHelper: iterate through arguments tree and spill ret_expr to local varibales. +// SpillRetExprHelper: iterate through arguments tree and spill ret_expr to local variables. // class SpillRetExprHelper { @@ -19901,15 +19901,16 @@ public: void StoreRetExprResultsInArgs(GenTreeCall* call) { - GenTree* args = call->gtCallArgs; - if (args != nullptr) + GenTreeArgList** pArgs = &call->gtCallArgs; + if (*pArgs != nullptr) { - comp->fgWalkTreePre(&args, SpillRetExprVisitor, this); + comp->fgWalkTreePre((GenTree**)pArgs, SpillRetExprVisitor, this); } - GenTree* thisArg = call->gtCallObjp; - if (thisArg != nullptr) + + GenTree** pThisArg = &call->gtCallObjp; + if (*pThisArg != nullptr) { - comp->fgWalkTreePre(&thisArg, SpillRetExprVisitor, this); + comp->fgWalkTreePre(pThisArg, SpillRetExprVisitor, this); } } -- 2.7.4