[PATCH] D12955: Fix assertion in inline assembler IR gen

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 21 05:53:37 PDT 2015


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

With one minor change, LGTM! Thank you for working on this.

~Aaron


================
Comment at: lib/Sema/SemaStmtAsm.cpp:447
@@ +446,3 @@
+    // Make sure no more than one input constraint matches each output.
+    assert(TiedTo >= 0 && TiedTo < InputMatchedToOutput.size());
+    if (InputMatchedToOutput[TiedTo] != ~0U) {
----------------
No need for the TiedTo >= 0 since it's an unsigned value anyway. Our usual way of writing this sort of assert is:


```
assert(TiedTo < InputMatchedToOutput.size() && "TiedTo value out of range");
```


http://reviews.llvm.org/D12955





More information about the cfe-commits mailing list