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

Unified Diff: include/v8.h

Issue 16365008: ReturnValue::Set(uint32_t) is wrong (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 6 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
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index b270e76dd698cb39ccf228178b44abb9d1b295de..32908fc27612da31f93cdcac97136ee11388974f 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5682,8 +5682,8 @@ void ReturnValue<T>::Set(int32_t i) {
template<typename T>
void ReturnValue<T>::Set(uint32_t i) {
typedef internal::Internals I;
- if (V8_LIKELY(I::IsValidSmi(i))) {
- *value_ = I::IntToSmi(i);
+ if (V8_LIKELY(i <= INT32_MAX)) {
+ Set(static_cast<int32_t>(i));
return;
}
Set(Integer::NewFromUnsigned(i, GetIsolate()));
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698