Closed BenSpencer closed 9 years ago
This seems to be a more general issue with getAttribute
, although the case of getAttribute("id")
does work, which is strange.
It seems the instrumentation of getAttribute
is correctly creating SymbolicObjectPropertyString
but SymbolicInterpreter::ail_jmp_iff
never receives a symbolic condition.
I know there is special handling of ids in some places, so maybe this is taking a different code path somewhere?
For example, jsHTMLElementId()
in JSHTMLElement.cpp
is instrumented separately. In this case it does not seem to be used in the getAttribute("id")
call, but maybe something like that is going on...?
getAttribute("name")
returns null
when there is no name
attribute defined on the parent element. This is correctly marked as symbolic by jsElementPrototypeFunctionGetAttribute
in JSElement.cpp
. When we get to the equality check the interpreter executes op_eq
which calls SymbolicInterpreter::ail_op_binary
with the EQUAL
operation. However, this code does not support conditions between string and null values, so the result is not handled symbolically.
See here for code.
EQUAL
/String/Null conditions to solve the current example.STRICT_EQUAL
, Int/Null, ...?).ail_op_binary
.)
Symbolic support for conditions of the form
event.target.getAttribute("name") == "interesting"
.See test
target-name-attr-check
in a35b8551.