Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Unified Diff: runtime/lib/error.cc

Issue 9693051: Add type checking to some native function arguments (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/lib/error.cc
===================================================================
--- runtime/lib/error.cc (revision 5412)
+++ runtime/lib/error.cc (working copy)
@@ -19,6 +19,8 @@
// Arg1: index of the first token after the failed assertion.
// Return value: none, throws an exception.
DEFINE_NATIVE_ENTRY(AssertionError_throwNew, 2) {
+ // No need to type check the arguments. This function can only be called
+ // internally from the VM.
intptr_t assertion_start = Smi::CheckedHandle(arguments->At(0)).Value();
intptr_t assertion_end = Smi::CheckedHandle(arguments->At(1)).Value();
@@ -55,6 +57,8 @@
// Arg4: malformed type error message.
// Return value: none, throws an exception.
DEFINE_NATIVE_ENTRY(TypeError_throwNew, 5) {
+ // No need to type check the arguments. This function can only be called
+ // internally from the VM.
intptr_t location = Smi::CheckedHandle(arguments->At(0)).Value();
const Instance& src_value = Instance::CheckedHandle(arguments->At(1));
const String& dst_type_name = String::CheckedHandle(arguments->At(2));

Powered by Google App Engine
This is Rietveld 408576698