diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-06-14 17:44:58 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-06-14 17:44:58 -0400 |
commit | 86270344f372ea02de71326b452e9d9434977b0f (patch) | |
tree | 85e924b24c9c2c9b2c94301382f290237e9cbf68 /gcc | |
parent | 761a3df02f7b72b609e8ba2a73b28d35092017ce (diff) | |
download | gcc-86270344f372ea02de71326b452e9d9434977b0f.zip gcc-86270344f372ea02de71326b452e9d9434977b0f.tar.gz gcc-86270344f372ea02de71326b452e9d9434977b0f.tar.bz2 |
(staticp, case FUNCTION_DECL): A nested function isn't static.
From-SVN: r7466
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1903,8 +1903,13 @@ staticp (arg) { switch (TREE_CODE (arg)) { - case VAR_DECL: case FUNCTION_DECL: + /* Nested functions aren't static. Since taking their address + involves a trampoline. */ + if (decl_function_context (arg) != 0) + return 0; + /* ... fall through ... */ + case VAR_DECL: return TREE_STATIC (arg) || DECL_EXTERNAL (arg); case CONSTRUCTOR: |