Rewrites a ternary choice operator to fix a compiler
authorwhesse@chromium.org <whesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 27 Oct 2008 12:24:22 +0000 (12:24 +0000)
committerwhesse@chromium.org <whesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 27 Oct 2008 12:24:22 +0000 (12:24 +0000)
linkage bug.

Review URL: http://codereview.chromium.org/8189

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@602 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/objects.cc
src/runtime.cc

index 7ffc819a1dde71a657f67142d328697e494ab1df..655fa66749b09df4001e5dcb83dd2e84b5a70ae2 100644 (file)
@@ -6789,6 +6789,4 @@ int BreakPointInfo::GetBreakPointCount() {
 }
 
 
-const int FunctionTemplateInfo::kSize;
-const int ObjectTemplateInfo::kSize;
 } }  // namespace v8::internal
index 048ebb72bf7791c53e2dbf820218f51c5d958423..66792def1291e77e7ecadc01b9584b7a27c1daf6 100644 (file)
@@ -327,8 +327,11 @@ static Object* Runtime_GetTemplateField(Arguments args) {
   RUNTIME_ASSERT(type ==  FUNCTION_TEMPLATE_INFO_TYPE ||
                  type ==  OBJECT_TEMPLATE_INFO_TYPE);
   RUNTIME_ASSERT(offset > 0);
-  RUNTIME_ASSERT(offset < ((type ==  FUNCTION_TEMPLATE_INFO_TYPE) ?
-      FunctionTemplateInfo::kSize : ObjectTemplateInfo::kSize));
+  if (type ==  FUNCTION_TEMPLATE_INFO_TYPE) {
+    RUNTIME_ASSERT(offset < FunctionTemplateInfo::kSize);
+  } else {
+    RUNTIME_ASSERT(offset < ObjectTemplateInfo::kSize);
+  }
   return HeapObject::RawField(templ, offset);
 }