Commit 1e5a1107 by Jason Merrill Committed by Jason Merrill

* calls.c (special_function_p): operator new may not be malloc-like.

From-SVN: r32308
parent 09496b7c
2000-03-03 Jason Merrill <jason@casey.cygnus.com>
* calls.c (special_function_p): operator new may not be malloc-like.
* gcse.c (dump_hash_table): Really fix error in last change.
2000-03-02 Denis Chertykov <denisc@overta.ru>
......
......@@ -634,16 +634,13 @@ special_function_p (fndecl, returns_twice, is_longjmp, fork_or_exec,
/* Do not add any more malloc-like functions to this list,
instead mark them as malloc functions using the malloc attribute.
Note, realloc is not suitable for attribute malloc since
it may return the same address across multiple calls. */
it may return the same address across multiple calls.
C++ operator new is not suitable because it is not required
to return a unique pointer; indeed, the standard placement new
just returns its argument. */
else if (! strcmp (tname, "malloc")
|| ! strcmp (tname, "calloc")
|| ! strcmp (tname, "strdup")
/* Note use of NAME rather than TNAME here. These functions
are only reserved when preceded with __. */
|| ! strcmp (name, "__vn") /* mangled __builtin_vec_new */
|| ! strcmp (name, "__nw") /* mangled __builtin_new */
|| ! strcmp (name, "__builtin_new")
|| ! strcmp (name, "__builtin_vec_new"))
|| ! strcmp (tname, "strdup"))
*is_malloc = 1;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment