Fix callee argument count bug in fgCanFastTailCall
authorHyeongseok Oh <hseok82.oh@samsung.com>
Tue, 24 Oct 2017 07:36:04 +0000 (16:36 +0900)
committerHyeongseok Oh <hseok82.oh@samsung.com>
Tue, 24 Oct 2017 07:36:04 +0000 (16:36 +0900)
Fix bug when callee uses return buffer:
return buffer argument is already generated in callee->gtCallArgs on import phase
So we should not increment calleeArgRegCount explicitly.

src/jit/morph.cpp

index 42c5a2a..81b25ec 100644 (file)
@@ -7295,7 +7295,7 @@ bool Compiler::fgCanFastTailCall(GenTreeCall* callee)
 
     if (callee->HasRetBufArg()) // RetBuf
     {
-        ++calleeArgRegCount;
+        // We don't increment calleeArgRegCount here, since it is already in callee->gtCallArgs.
 
         // If callee has RetBuf param, caller too must have it.
         // Otherwise go the slow route.