Errs in function args not being passed along#95
Closed
Levilutz wants to merge 990 commits intocmsc430:mainfrom
Closed
Errs in function args not being passed along#95Levilutz wants to merge 990 commits intocmsc430:mainfrom
Levilutz wants to merge 990 commits intocmsc430:mainfrom
Conversation
* explain compilation of `begin' * explain push, pop, call * explain ABI for calling C * explain "extern" in ASM * discuss asm-interp/io as analog of interp-io * show examples with asm-interp/io, asm-interp only for "pure" programs * add peek-byte?
This reverts commit 459159d. This included some other changes that broke the build, so reverting for now.
This reverts commit 48a2fae. Redo in order to fix up.
There's a challenge in getting Extort and asm-interp to play nice together. The problem is that Extort, which adds handled errors, calls a C function named `error` which prints a symbol and exits. If you do this from `asm-interp` this will exit whatever is running `asm-interp`, prematurely exiting out of whatever you're trying to do (build the web page, test the code, etc.). Not what you want. The solution, as always, is a level of indirection. The run-time now has a function pointer called `error`. The `main` procedure sets to something that prints and exits. On the other hand `asm-interp` sets it to something that raises an exception and then handles it. This commit isn't the end-all for these kinds of issues, but it's a first cut and the API for hooking in to the run-time can be refined based on this basic idea.
It wasn't a good idea to name the function `error`.
This includes many updates+fixes. Here are the highlights:
* New implementations for Knock+Jig
* Update of notes from the sexpr style to the a86 style (up to Knock)
* Update of test suite for Hustle+Iniquity+Jig
(not Knock because Racket doesn't have the `call` functionality built-in)
Returning a simple 'err was violating the expected structure implied by function application code
Loot failed this prior to 20913cb
Author
|
For following file as Previous behavior: New behavior: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See new test for almost-minimal example of bug.
Any 'err present in the arguments of a function would cause the interpreter to fail rather than cleanly returning 'err.
Specifically, when a function arg would bring error, interp-env* returned 'err. This would truncate the overall list being returned, causing unpredictable behavior (either lambda arg length mismatch or interpreter failure).