mirror of
https://github.com/RGBCube/serenity
synced 2025-05-17 20:55:07 +00:00

RecursiveASTVisitor was recursing into the subtrees of an old root if it was changed in on_entry callback. Fix that by querying root pointer just after on_entry callback returns. While on it, also use `AK::TemporaryChange` instead of setting `m_current_subtree_pointer` manually. As it turns out, `FunctionCallCanonicalizationPass` was relying on being able to replace tree on entry, and the bug in RecursiveASTVisitor made the pass to not fully canonicalize nested function calls. The changes to GenericASTPass.cpp alone are enough to fix the problem but it is canonical (for some definition of canonicity) to only change trees in on_leave. Therefore, the commit also switches FunctionCallCanonicalizationPass to on_leave callback. A test for this fix and one from the previous commit is also included.
35 lines
1.7 KiB
XML
35 lines
1.7 KiB
XML
<!DOCTYPE inline_dtd[<!ENTITY nbsp " ">]>
|
||
<specification>
|
||
<emu-import href="spec/celestial.html">
|
||
<emu-clause id="sec-celestial-now-object">
|
||
<h1><span class="secnum">2</span> The Celestial.Now Object</h1>
|
||
<emu-clause id="sec-celestial-now-abstract-ops">
|
||
<h1><span class="secnum">2.3</span> Abstract Operations</h1>
|
||
<emu-clause id="sec-celestial-systemutcepochmilliseconds" aoid="SystemUTCEpochMilliseconds">
|
||
<h1><span class="secnum">2.3.2</span> SystemUTCEpochMilliseconds ( )</h1>
|
||
<emu-alg>
|
||
<ol>
|
||
<li>
|
||
Let <var>global</var> be
|
||
<emu-xref aoid="GetGlobalObject"><a href="https://tc39.es/ecma262/#sec-getglobalobject">GetGlobalObject</a></emu-xref>
|
||
().
|
||
</li>
|
||
<li>
|
||
Let <var>nowNs</var> be
|
||
<emu-xref aoid="HostSystemUTCEpochNanoseconds" id="_ref_119"><a href="#sec-hostsystemutcepochnanoseconds">HostSystemUTCEpochNanoseconds</a></emu-xref>
|
||
(<var>global</var>).
|
||
</li>
|
||
<li>
|
||
Return
|
||
<emu-xref aoid="𝔽"><a href="https://tc39.es/ecma262/#𝔽">𝔽</a></emu-xref>
|
||
(
|
||
<emu-xref aoid="floor"><a href="https://tc39.es/ecma262/#eqn-floor">floor</a></emu-xref>
|
||
(<var>nowNs</var> / 1000000)).
|
||
</li>
|
||
</ol>
|
||
</emu-alg>
|
||
</emu-clause>
|
||
</emu-clause>
|
||
</emu-clause>
|
||
</emu-import>
|
||
</specification>
|