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
This code makes function main() call itself recursively, causing a stack/heap collision.
The reason is that Func() is defined without the public specifier and the function is not called directly, so the compiler doesn't generate any code for it, thinking it's unused. But because Func() has a public specifier in its declaration, the compiler still creates an entry for this function in the public functions table.
As a result, since there's no code for Func(), the entry points at main() instead, which causes recursion.
Minimal complete verifiable example (MCVE):
See above.
Workspace Information:
Compiler version: 3.2.3664, 3.10.10
Command line arguments provided (or sampctl version):
Operating System:
The text was updated successfully, but these errors were encountered:
For now I'm not sure how to properly handle this bug.
Should we silently treat such functions as public, even if they don't have the public specifier in their definition, or rather issue error 025 (function heading differs from prototype)? @Y-Less?
Issue description:
This code makes function
main()
call itself recursively, causing a stack/heap collision.The reason is that
Func()
is defined without thepublic
specifier and the function is not called directly, so the compiler doesn't generate any code for it, thinking it's unused. But becauseFunc()
has apublic
specifier in its declaration, the compiler still creates an entry for this function in the public functions table.As a result, since there's no code for
Func()
, the entry points atmain()
instead, which causes recursion.Minimal complete verifiable example (MCVE):
See above.
Workspace Information:
The text was updated successfully, but these errors were encountered: