57 Commits

Author SHA1 Message Date
Sergei Marochkin
b5959fcf15 Remove Linux crash lines 2016-09-05 11:16:56 +03:00
Marcin Misiurski
8e11f682d6 Fix enum field size (credit to @Arkshine) 2015-03-25 14:19:10 +01:00
Zeex
4d2c600507 Fix crash on error 33 in ternary operator
If one of the two values is a string literal and the other is a
non-array, the symbol associated with the first one will be NULL.
But the code checked if sym->name!=NULL rather than sym!=NULL,
hence the crash.

--------- test code --------

main() {
    new a, b;
    return (a != 0 ? b : "string");
}

----- end of test code -----
2014-04-21 10:52:44 +07:00
Zeex
53ef10ffc7 Fix crash when using tagof(tagname:)
This fixes #18.
2014-02-19 22:31:50 +07:00
Zeex
53221dd2cc Introduce #pragma naked
When applied to a function #pragma naked merely disables the "should return
a value" warning for the function. It's intended to be used with functions
that return a value via #emit instead of the normal return statement.

This pragma works only on function definitions, not declarations. It's also
pretty stupid - the function may be defined way after this directive and it
won't stop on things coming in between.

For example, here all declarations between #pragma naked and f() are
effectively ignored:

#pragma naked

new x;       // ignored
forward g(); // ignored
native n();  // ignored

f() {
    // f() becomes naked
}

Note that #pragma naked does not affect generated code in any way, unlike
e.g. __declspec(naked) or __attribute__((naked)) in C/C++ where the compiler
omits the code for the prolog and epilog.
2014-01-05 01:26:10 +07:00
Zeex
c20d9cb33b Fix compile crash when calling a function at global scope
This fixes a crash that occurs if a global variable is initialized
with the result of a function call.

See 3) here: http://forum.sa-mp.com/showthread.php?t=355877

--------- test code --------

native use(...);

f() {
	return 0;
}

new x = f();

main() {
	use(x);
}

----- end of test code -----
2014-01-01 16:49:55 +07:00
Zeex
766b96bcf3 Lower case directory names 2013-09-19 13:06:46 +07:00