Permalink
Browse files

v8: work around String::WriteAscii segfault

See http://code.google.com/p/v8/issues/detail?id=2493 for details.

This commit reapplies 9668df8. The issue has been fixed upstream but
reappeared after last night's downgrade to V8 3.14.5 in commit b15a10e.

Conflicts:
	test/simple/test-buffer.js
  • Loading branch information...
1 parent aa98539 commit 3c2c08e9b88faf71fc25843c81466b10cbb7d044 @bnoordhuis committed Jan 15, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 deps/v8/src/v8utils.h
View
@@ -209,6 +209,8 @@ INLINE(void CopyChars(sinkchar* dest, const sourcechar* src, int chars));
template <typename sourcechar, typename sinkchar>
void CopyChars(sinkchar* dest, const sourcechar* src, int chars) {
+ ASSERT(chars >= 0);
+ if (chars == 0) return;
sinkchar* limit = dest + chars;
#ifdef V8_HOST_CAN_READ_UNALIGNED
if (sizeof(*dest) == sizeof(*src)) {

0 comments on commit 3c2c08e

Please sign in to comment.