Subzero: Fix off-by-one asserts in intrinsic info lookup routines.

It turns out that getNumArgs() and getReturnType() were never actually called except to print errors, so this bug was never encountered until now.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4315
R=ascull@google.com

Review URL: https://codereview.chromium.org/1347683002 .
diff --git a/src/IceIntrinsics.cpp b/src/IceIntrinsics.cpp
index b1ca40d..1dc25cc 100644
--- a/src/IceIntrinsics.cpp
+++ b/src/IceIntrinsics.cpp
@@ -315,17 +315,17 @@
 }
 
 Intrinsics::ValidateCallValue
-Intrinsics::FullIntrinsicInfo::validateCall(const Ice::InstCall *Call,
+Intrinsics::FullIntrinsicInfo::validateCall(const InstCall *Call,
                                             SizeT &ArgIndex) const {
   assert(NumTypes >= 1);
   Variable *Result = Call->getDest();
   if (Result == nullptr) {
-    if (Signature[0] != Ice::IceType_void)
+    if (getReturnType() != IceType_void)
       return Intrinsics::BadReturnType;
-  } else if (Signature[0] != Result->getType()) {
+  } else if (getReturnType() != Result->getType()) {
     return Intrinsics::BadReturnType;
   }
-  if (Call->getNumArgs() + 1 != NumTypes) {
+  if (Call->getNumArgs() != getNumArgs()) {
     return Intrinsics::WrongNumOfArgs;
   }
   for (size_t i = 1; i < NumTypes; ++i) {
diff --git a/src/IceIntrinsics.h b/src/IceIntrinsics.h
index 75e67aa..9270aa4 100644
--- a/src/IceIntrinsics.h
+++ b/src/IceIntrinsics.h
@@ -140,13 +140,13 @@
 
     /// Returns the return type of the intrinsic.
     Type getReturnType() const {
-      assert(NumTypes > 1);
+      assert(NumTypes > 0);
       return Signature[0];
     }
 
     /// Returns number of arguments expected.
     SizeT getNumArgs() const {
-      assert(NumTypes > 1);
+      assert(NumTypes > 0);
       return NumTypes - 1;
     }