Revision: 6064
Author: [email protected]
Date: Fri Dec 17 03:52:10 2010
Log: Avoid comparing a pointer-to-member to NULL, even though C++ is supposed to support it.
Review URL: http://codereview.chromium.org/5988001
http://code.google.com/p/v8/source/detail?r=6064

Modified:
 /branches/bleeding_edge/src/full-codegen.cc

=======================================
--- /branches/bleeding_edge/src/full-codegen.cc Thu Dec 16 05:13:36 2010
+++ /branches/bleeding_edge/src/full-codegen.cc Fri Dec 17 03:52:10 2010
@@ -671,8 +671,12 @@

 FullCodeGenerator::InlineFunctionGenerator
   FullCodeGenerator::FindInlineFunctionGenerator(Runtime::FunctionId id) {
-    return kInlineFunctionGenerators[
- static_cast<int>(id) - static_cast<int>(Runtime::kFirstInlineFunction)];
+    int lookup_index =
+ static_cast<int>(id) - static_cast<int>(Runtime::kFirstInlineFunction);
+    ASSERT(lookup_index >= 0);
+    ASSERT(static_cast<size_t>(lookup_index) <
+           ARRAY_SIZE(kInlineFunctionGenerators));
+    return kInlineFunctionGenerators[lookup_index];
 }


@@ -684,7 +688,6 @@
   ASSERT(function->intrinsic_type == Runtime::INLINE);
   InlineFunctionGenerator generator =
       FindInlineFunctionGenerator(function->function_id);
-  ASSERT(generator != NULL);
   ((*this).*(generator))(args);
 }

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to