mirror of
https://github.com/mirror/make.git
synced 2025-01-30 06:11:02 +08:00
[SV 63315] Allocate function names when defining functions
* src/function.c (define_new_function): Don't keep a pointer to the user-provided name of a user-defined function: if the .so is unloaded it will point to garbage. Add the name to the strcache instead.
This commit is contained in:
parent
d71c0bb0ce
commit
e80ce6fc90
@ -2801,7 +2801,7 @@ define_new_function (const floc *flocp, const char *name,
|
||||
_("Invalid maximum argument count (%u) for function %s"), max, name);
|
||||
|
||||
ent = xmalloc (sizeof (struct function_table_entry));
|
||||
ent->name = name;
|
||||
ent->name = strcache_add (name);
|
||||
ent->len = (unsigned char) len;
|
||||
ent->minimum_args = (unsigned char) min;
|
||||
ent->maximum_args = (unsigned char) max;
|
||||
|
Loading…
Reference in New Issue
Block a user