Title: [99474] trunk/Source/_javascript_Core
- Revision
- 99474
- Author
- [email protected]
- Date
- 2011-11-07 14:10:08 -0800 (Mon, 07 Nov 2011)
Log Message
REGRESSION(r99436): Broke Snow Leopard debug build
https://bugs.webkit.org/show_bug.cgi?id=71713
Reviewed by Darin Adler.
Put the assertion in a template and use template specialization
to avoid warning when instantiated with UChar or LChar.
In the long term, we should have traits for unsigned integral types
and use that to specialize template instead of specializing it for UChar and LChar.
* parser/Lexer.cpp:
(JSC::assertCharIsIn8BitRange):
(JSC::::append8):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (99473 => 99474)
--- trunk/Source/_javascript_Core/ChangeLog 2011-11-07 22:09:12 UTC (rev 99473)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-11-07 22:10:08 UTC (rev 99474)
@@ -1,3 +1,20 @@
+2011-11-07 Ryosuke Niwa <[email protected]>
+
+ REGRESSION(r99436): Broke Snow Leopard debug build
+ https://bugs.webkit.org/show_bug.cgi?id=71713
+
+ Reviewed by Darin Adler.
+
+ Put the assertion in a template and use template specialization
+ to avoid warning when instantiated with UChar or LChar.
+
+ In the long term, we should have traits for unsigned integral types
+ and use that to specialize template instead of specializing it for UChar and LChar.
+
+ * parser/Lexer.cpp:
+ (JSC::assertCharIsIn8BitRange):
+ (JSC::::append8):
+
2011-11-07 ChangSeok Oh <[email protected]>
[EFL] Support requestAnimationFrame API
Modified: trunk/Source/_javascript_Core/parser/Lexer.cpp (99473 => 99474)
--- trunk/Source/_javascript_Core/parser/Lexer.cpp 2011-11-07 22:09:12 UTC (rev 99473)
+++ trunk/Source/_javascript_Core/parser/Lexer.cpp 2011-11-07 22:10:08 UTC (rev 99474)
@@ -426,6 +426,24 @@
}
template <typename T>
+inline void assertCharIsIn8BitRange(T c)
+{
+ ASSERT(c >= 0);
+ ASSERT(c <= 0xFF);
+}
+
+template <>
+inline void assertCharIsIn8BitRange(UChar c)
+{
+ ASSERT(c <= 0xFF);
+}
+
+template <>
+inline void assertCharIsIn8BitRange(LChar)
+{
+}
+
+template <typename T>
inline void Lexer<T>::append8(const T* p, size_t length)
{
// FIXME: Change three occurrances of m_buffer16 to m_buffer8 and
@@ -436,8 +454,7 @@
for (size_t i = 0; i < length; i++) {
T c = p[i];
- ASSERT(c >= 0);
- ASSERT(c <= 0xFF);
+ assertCharIsIn8BitRange(c);
rawBuffer[i] = c;
}
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes