File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -529,12 +529,12 @@ const Argument* cppUtil::getConstructorThisPtr(const Function* fun)
529529{
530530 assert ((isConstructor (fun) || isDestructor (fun)) &&
531531 " not a constructor?" );
532- // If param 0 is sret, 'this' is typically param 1, but be defensive.
533- const bool isStructRet = fun->hasParamAttribute (0 , llvm::Attribute::StructRet);
534-
535532 // We always need at least one argument to return something meaningful.
536533 assert (fun->arg_size () >= 1 && " expected at least one argument" );
537534
535+ // If param 0 is sret, 'this' is typically param 1, but be defensive.
536+ const bool isStructRet = fun->hasParamAttribute (0 , llvm::Attribute::StructRet);
537+
538538 // Prefer arg1 when sret is present and available; otherwise fall back to arg0.
539539 const u32_t thisIdx = (isStructRet && fun->arg_size () >= 2 ) ? 1 : 0 ;
540540 const Argument* thisPtr = fun->getArg (thisIdx);
You can’t perform that action at this time.
0 commit comments