From c80bde1781a99db34d3457620bc77aca7a37cc75 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 15 Jan 2013 23:42:23 +0100 Subject: [PATCH] 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 --- deps/v8/src/v8utils.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deps/v8/src/v8utils.h b/deps/v8/src/v8utils.h index 9072b4e285..111abdf8b8 100644 --- a/deps/v8/src/v8utils.h +++ b/deps/v8/src/v8utils.h @@ -209,6 +209,8 @@ INLINE(void CopyChars(sinkchar* dest, const sourcechar* src, int chars)); template 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)) {