You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When printing large, nested objects, the printing algorithm holds on to state in a while worklist and makes recursive calls that can reach user callbacks, which can trigger stack operations. Pretty-printing a large AST of thousands of nodes in constructor notation can have unexpected results because of this.
The toReprJS function needs to be rewritten to take this into account (I believe @thejakeellis deserves credit for predicting this in early Jan). It currently uses safeCall to guard the callbacks, but the context of the safeCall is not stack-safe (it has a non-empty continuation that isn't made explicit). As a result information can be lost or completely erroneous results (e.g. a JavaScript string instead of a Pyret string) can be returned.
The text was updated successfully, but these errors were encountered:
Most likely closed by 7098cc2. Some more testing is needed to be sure, but I have definitely gotten correct output in stack-overflowing situations using this algorithm that did not succeed with the previous one. The compiler still builds and passes all tests, so no regressions there...
When printing large, nested objects, the printing algorithm holds on to state in a
while
worklist and makes recursive calls that can reach user callbacks, which can trigger stack operations. Pretty-printing a large AST of thousands of nodes in constructor notation can have unexpected results because of this.The
toReprJS
function needs to be rewritten to take this into account (I believe @thejakeellis deserves credit for predicting this in early Jan). It currently usessafeCall
to guard the callbacks, but the context of thesafeCall
is not stack-safe (it has a non-empty continuation that isn't made explicit). As a result information can be lost or completely erroneous results (e.g. a JavaScript string instead of a Pyret string) can be returned.The text was updated successfully, but these errors were encountered: