-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix generation of function addresses in #emit code
This fixes a bug where the compiler generated incorrect addresses for functions in #emit code if they were defined after the point of use. For example, you couldn't reliably get the address of a function with "#emit CONST.pri XXX" unless you make sure that XXX is defined before the function in which you have you are referencing it. Now the resolution of the function's address is deferred until assembling phase (as with CALL), and the assembler is guaranteed to see all symbols with their final addresses. To distinguish between functions and numeric operands I added a '.' (period) in front of function names for both #emit and normal calls. See also 5) here: http://forum.sa-mp.com/showthread.php?t=355877 --------- test code -------- #include <a_samp> // DO NOT REMOVE THIS main() { #emit const.pri foo } stock foo() { printf("Hello, World!"); } ----- end of test code -----
- Loading branch information
Showing
3 changed files
with
40 additions
and
16 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