History

Check if symbol given for attr. cleanup is actually a function

Udo committed 6 years ago

Commit c092f2e1 parent 7e901291 file · +7 −1Browse files

Unified · Split

tccgen.c+7−1
@@ -3664,7 +3664,13 @@ redo: · 3663 unmodified lines
36643664 tcc_warning("implicit declaration of function '%s'",
36653665 get_tok_str(tok, &tokc));
36663666 s = external_global_sym(tok, &func_old_type);
3667− }
3667+ }
3668+ else if ( (s->type.t & VT_BTYPE) == VT_FUNC ) {
3669+ ad->cleanup_func = s;
3670+ }
3671+ else {
3672+ tcc_error("'%s' is not declared as function", get_tok_str(tok, &tokc));
3673+ }
36683674 ad->cleanup_func = s;
36693675 next();
36703676 skip(')');

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t