mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 09:51:41 +00:00
catch redefined functions
This commit is contained in:
parent
c3f41e3e69
commit
0fe4c2a600
2 changed files with 6 additions and 0 deletions
|
@ -219,6 +219,10 @@ build_builtin_function (def_t *def, expr_t *bi_val)
|
|||
error (bi_val, "%s is not a function", def->name);
|
||||
return 0;
|
||||
}
|
||||
if (def->constant) {
|
||||
error (bi_val, "%s redefined", def->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (bi_val->type != ex_integer && bi_val->type != ex_float) {
|
||||
error (bi_val, "invalid constant for = #");
|
||||
|
|
|
@ -624,6 +624,8 @@ opt_comma
|
|||
begin_function
|
||||
: /*empty*/
|
||||
{
|
||||
if ($<def>0->constant)
|
||||
error (0, "%s redefined", $<def>0->name);
|
||||
$$ = current_func = new_function ($<def>0->name);
|
||||
$$->def = $<def>0;
|
||||
$$->refs = new_reloc ($$->def->ofs, rel_def_func);
|
||||
|
|
Loading…
Reference in a new issue