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

Side by Side Diff: runtime/bin/builtin_natives.cc

Issue 10414021: Reland: Add more API fuzzing and fix the issues encountered. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/dartutils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "bin/builtin.h" 5 #include "bin/builtin.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "bin/dartutils.h" 10 #include "bin/dartutils.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 123
124 void FUNCTION_NAME(Logger_PrintString)(Dart_NativeArguments args) { 124 void FUNCTION_NAME(Logger_PrintString)(Dart_NativeArguments args) {
125 Dart_EnterScope(); 125 Dart_EnterScope();
126 Builtin::PrintString(stdout, Dart_GetNativeArgument(args, 0)); 126 Builtin::PrintString(stdout, Dart_GetNativeArgument(args, 0));
127 Dart_ExitScope(); 127 Dart_ExitScope();
128 } 128 }
129 129
130 void FUNCTION_NAME(Exit)(Dart_NativeArguments args) { 130 void FUNCTION_NAME(Exit)(Dart_NativeArguments args) {
131 Dart_EnterScope(); 131 Dart_EnterScope();
132 int64_t status = DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 0)); 132 int64_t status = 0;
133 // Ignore result if passing invalid argument and just exit 0.
134 DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status);
133 Dart_ExitScope(); 135 Dart_ExitScope();
134 exit(status); 136 exit(status);
135 } 137 }
136 138
137 139
138 void Builtin::SetNativeResolver(Builtin::BuiltinLibraryId id) { 140 void Builtin::SetNativeResolver(Builtin::BuiltinLibraryId id) {
139 Dart_Handle url; 141 Dart_Handle url;
140 if (id == Builtin::kBuiltinLibrary) { 142 if (id == Builtin::kBuiltinLibrary) {
141 url = Dart_NewString(DartUtils::kBuiltinLibURL); 143 url = Dart_NewString(DartUtils::kBuiltinLibURL);
142 } else { 144 } else {
143 ASSERT(id == Builtin::kIOLibrary); 145 ASSERT(id == Builtin::kIOLibrary);
144 url = Dart_NewString(DartUtils::kIOLibURL); 146 url = Dart_NewString(DartUtils::kIOLibURL);
145 } 147 }
146 Dart_Handle builtin_lib = Dart_LookupLibrary(url); 148 Dart_Handle builtin_lib = Dart_LookupLibrary(url);
147 DART_CHECK_VALID(builtin_lib); 149 DART_CHECK_VALID(builtin_lib);
148 // Setup the native resolver for built in library functions. 150 // Setup the native resolver for built in library functions.
149 Dart_Handle result = Dart_SetNativeResolver(builtin_lib, NativeLookup); 151 Dart_Handle result = Dart_SetNativeResolver(builtin_lib, NativeLookup);
150 DART_CHECK_VALID(result); 152 DART_CHECK_VALID(result);
151 } 153 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/dartutils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698