[llvm-commits] [llvm] r153234 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
Duncan Sands
baldrick at free.fr
Fri Mar 23 01:32:39 PDT 2012
Hi Eric,
> URL: http://llvm.org/viewvc/llvm-project?rev=153234&view=rev
> Log:
> In erroneous inline assembly we could mistakenly try to access the
> metadata operand as an actual operand, leading to an assert. Error
> out in this case.
>
> rdar://11007633
baldrick bot says: "testcase?"
Ciao, Duncan.
>
> Modified:
> llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp?rev=153234&r1=153233&r2=153234&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp Wed Mar 21 20:33:51 2012
> @@ -326,7 +326,11 @@
> OpNo += InlineAsm::getNumOperandRegisters(OpFlags) + 1;
> }
>
> - if (OpNo>= MI->getNumOperands()) {
> + // We may have a location metadata attached to the end of the
> + // instruction, and at no point should see metadata at any
> + // other point while processing. It's an error if so.
> + if (OpNo>= MI->getNumOperands() ||
> + MI->getOperand(OpNo).isMetadata()) {
> Error = true;
> } else {
> unsigned OpFlags = MI->getOperand(OpNo).getImm();
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list