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
Crashes the compiler because ETA-reduction in Importer is greedy and skips rebuilding test, only attempting to rebuild the callee test2, and then vice versa, endlessly up until we get a segfault.
The text was updated successfully, but these errors were encountered:
diff --git a/src/thorin/transform/importer.cpp b/src/thorin/transform/importer.cpp
index 2bebb9d07..6c97a0cb9 100644
--- a/src/thorin/transform/importer.cpp+++ b/src/thorin/transform/importer.cpp@@ -65,10 +65,15 @@ const Def* Importer::rewrite(const Def* const odef) {
goto rebuild;
if (body->args() == cont->params_as_defs()) {
- src().VLOG("simplify: continuation {} calls a free def: {}", cont->unique_name(), body->callee());
// We completely replace the original continuation
// If we don't do so, then we miss some simplifications
- return instantiate(body->callee());+ src().VLOG("simplify: continuation {} calls a free def: {}", cont->unique_name(), body->callee());+ // However, we need a safety in the case of 'naked' recursion:+ auto safety = cont->stub(*this, instantiate(cont->type())->as<FnType>());+ insert(odef, safety);+ auto eta_reduced = instantiate(body->callee());+ safety->jump(eta_reduced, safety->params_as_defs());+ return eta_reduced;
} else {
// build the permutation of the arguments
Array<size_t> perm(body->num_args());
The following snippet (written using AnyDSL/artic#23):
Crashes the compiler because ETA-reduction in
Importer
is greedy and skips rebuildingtest
, only attempting to rebuild the calleetest2
, and then vice versa, endlessly up until we get a segfault.The text was updated successfully, but these errors were encountered: