-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix crash when initializing string variable with a non-string value
- Loading branch information
Showing
5 changed files
with
44 additions
and
59 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,11 @@ | ||
%address $A000 | ||
%memtop $C000 | ||
%output library | ||
|
||
%import textio | ||
|
||
|
||
main { | ||
; Create a jump table as first thing in the library. | ||
; uword[] @shared @nosplit jumptable = [ | ||
; ; NOTE: the compiler has inserted a single JMP instruction at the start of the 'main' block, that jumps to the start() routine. | ||
; ; This is convenient because the rest of the jump table simply follows it, | ||
; ; making the first jump neatly be the required initialization routine for the library (initializing variables and BSS region). | ||
; ; btw, $4c = opcode for JMP. | ||
; $4c00, &library.func1, | ||
; $4c00, &library.func2, | ||
; ] | ||
|
||
%jmptable ( | ||
library.func1, | ||
library.func2, | ||
) | ||
|
||
sub start() { | ||
; has to be here for initialization | ||
txt.print("lib initialized\n") | ||
} | ||
} | ||
|
||
|
||
library { | ||
sub func1() { | ||
txt.print("lib func 1\n") | ||
str minString1 = 1234 | ||
str minString2 = func() | ||
} | ||
|
||
sub func2() { | ||
txt.print("lib func 2\n") | ||
sub func() -> str { | ||
return "zz" | ||
} | ||
} |