diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 523f5450564..7915e2f50a5 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1645,8 +1645,9 @@ void DwarfDebug::addScopeVariable(LexicalScope *LS, DbgVariable *Var) { if (CurNum == 0) break; // A later indexed parameter has been found, insert immediately before it. - if (CurNum < ArgNum) + if (CurNum > ArgNum) break; + ++I; } Vars.insert(I, Var); return;