This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes some problems reported by @xlab in #2977.
The first of these is that having nonconsecutive sources can crash the debugger. I fixed both the part that xlab pointed out, and another point in the code I found that could have trouble on nonconsecutive sources (hopefully these were indeed the only such spots).
The second of these is a bit more mysterious: If the check that xlab pointed out was fixed, the debugger would hang on startup. On investigation, I determined that there were two particular ASTs that would never finish walking. I was unable to determine any reason for this. However, I replaced the uses of
yield call(walk, ...)
in the AST saga with a simpleyield* walk(...)
, and this somehow caused the problem to go away. (No, we're not somehow losing parallelism here;yield call
is completely synchronous.) I have no idea why; some sort of weird redux-saga internal thing got overloaded from all the effects, maybe? IDK. But this fixed the problem, so, uh, I'm sticking with it.Finally, I altered the CLI logic to force a recompile if source indices are not consecutive. Now, you may recall that the first commit in this PR fixes problems caused by nonconsecutive indices, so why do this? Because nonconsecutive sources, while they should no longer cause a problem, still indicate a problem. In the case of xlab's repo, the nonconsecutivity was due to name collisions, which Truffle infamously can't really handle. Or at least, Truffle's artifacts can't handle this, but the raw compiler output can, so by forcing a recompile we avoid the problem. (At the cost of a lot of time.)