Ignore:
Timestamp:
Jul 23, 2013, 5:56:52 PM (12 years ago)
Author:
[email protected]
Message:

Added ExpressionRangeInfo for BinaryOpNodes that can throw exceptions
due to type coersion.
https://bugs.webkit.org/show_bug.cgi?id=116853.

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

  • bytecompiler/NodesCodegen.cpp:

(JSC::BinaryOpNode::emitBytecode):

  • Added expression info for the strcat and the general binary op cases. I did not add expression info for the "compare with null" case because that comparison cannot trigger type coersion, and hence it won't throw any exceptions and doesn't need the expression info.

LayoutTests:

Added the test case from bugzilla which exercises the general binary op
type coersion case, plus another for exercising the strcat case.

  • fast/js/line-column-numbers-expected.txt:
  • fast/js/line-column-numbers.html:
  • fast/js/script-tests/line-column-numbers.js:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r153071 r153073  
    10961096    OpcodeID opcodeID = this->opcodeID();
    10971097
    1098     if (opcodeID == op_add && m_expr1->isAdd() && m_expr1->resultDescriptor().definitelyIsString())
     1098    if (opcodeID == op_add && m_expr1->isAdd() && m_expr1->resultDescriptor().definitelyIsString()) {
     1099        generator.emitExpressionInfo(startOffset(), 0, 0, lineNo(), lineStartOffset());
    10991100        return emitStrcat(generator, dst);
     1101    }
    11001102
    11011103    if (opcodeID == op_neq) {
     
    11171119    bool wasTypeof = generator.m_lastOpcodeID == op_typeof;
    11181120    RegisterID* src2 = generator.emitNode(right);
     1121    generator.emitExpressionInfo(startOffset(), 0, 0, lineNo(), lineStartOffset());
    11191122    if (wasTypeof && (opcodeID == op_neq || opcodeID == op_nstricteq)) {
    11201123        RefPtr<RegisterID> tmp = generator.tempDestination(dst);
Note: See TracChangeset for help on using the changeset viewer.