Jit: fix gtIsRecursiveCall
authorAndy Ayers <andya@microsoft.com>
Tue, 14 Feb 2017 02:38:14 +0000 (18:38 -0800)
committerAndy Ayers <andya@microsoft.com>
Tue, 14 Feb 2017 02:38:14 +0000 (18:38 -0800)
When called from the inline compiler, this needs to look at the root
method's handle, not the inlined method's handle.

Fixes #9568.

src/jit/compiler.h

index 7c5565c..259c4cb 100644 (file)
@@ -2138,9 +2138,10 @@ public:
     bool gtIsStaticFieldPtrToBoxedStruct(var_types fieldNodeType, CORINFO_FIELD_HANDLE fldHnd);
 
     // Return true if call is a recursive call; return false otherwise.
+    // Note when inlining, this looks for calls back to the root method.
     bool gtIsRecursiveCall(GenTreeCall* call)
     {
-        return (call->gtCallMethHnd == info.compMethodHnd);
+        return (call->gtCallMethHnd == impInlineRoot()->info.compMethodHnd);
     }
 
     //-------------------------------------------------------------------------