File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -102,19 +102,11 @@ void CodeGen::genEmitGSCookieCheck(bool pushReg)
102102    if  (!pushReg)
103103    {
104104        //  Non-tail call: we can use any callee trash register that is not
105-         //  a return register or contain 'this' pointer (keep alive this), since
106-         //  we are generating GS cookie check after a GT_RETURN block.
107-         //  Note: On Amd64 System V RDX is an arg register - REG_ARG_2 - as well
108-         //  as return register for two-register-returned structs.
109-         if  (compiler->lvaKeepAliveAndReportThis () && compiler->lvaGetDesc (compiler->info .compThisArg )->lvIsInReg () &&
110-             (compiler->lvaGetDesc (compiler->info .compThisArg )->GetRegNum () == REG_ARG_0))
111-         {
112-             regGSCheck = REG_ARG_1;
113-         }
114-         else 
115-         {
116-             regGSCheck = REG_ARG_0;
117-         }
105+         //  a return register or contain 'this' pointer (keep alive this), or
106+         //  a continuation register, since we are generating GS cookie check
107+         //  after a GT_RETURN block.
108+         //  ARG_1 is EDX or RSI, depending on platform. Either way it fits our reqirements
109+         regGSCheck = REG_ARG_1;
118110    }
119111    else 
120112    {
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments