Browse Source

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
v0.9.11-release
Ben Noordhuis 12 years ago
parent
commit
c80bde1781
  1. 2
      deps/v8/src/v8utils.h

2
deps/v8/src/v8utils.h

@ -209,6 +209,8 @@ INLINE(void CopyChars(sinkchar* dest, const sourcechar* src, int chars));
template <typename sourcechar, typename sinkchar> template <typename sourcechar, typename sinkchar>
void CopyChars(sinkchar* dest, const sourcechar* src, int chars) { void CopyChars(sinkchar* dest, const sourcechar* src, int chars) {
ASSERT(chars >= 0);
if (chars == 0) return;
sinkchar* limit = dest + chars; sinkchar* limit = dest + chars;
#ifdef V8_HOST_CAN_READ_UNALIGNED #ifdef V8_HOST_CAN_READ_UNALIGNED
if (sizeof(*dest) == sizeof(*src)) { if (sizeof(*dest) == sizeof(*src)) {

Loading…
Cancel
Save