Skip to content

Commit

Permalink
v8: work around String::WriteAscii segfault
Browse files Browse the repository at this point in the history
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

Conflicts:
	deps/v8/src/v8utils.h
  • Loading branch information
bnoordhuis authored and indutny committed Feb 28, 2013
1 parent 48aef3f commit f3b04da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deps/v8/src/v8utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,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;
ASSERT(sizeof(sourcechar) <= 2);
ASSERT(sizeof(sinkchar) <= 2);
if (sizeof(sinkchar) == 1) {
Expand Down Expand Up @@ -240,6 +242,8 @@ void CopyChars(sinkchar* dest, const sourcechar* src, int chars) {

template <typename sourcechar, typename sinkchar>
void CopyCharsUnsigned(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)) {
Expand Down

0 comments on commit f3b04da

Please sign in to comment.