summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-04 20:00:44 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-04 20:00:44 +0000
commit502cb098c4503722dac0fccbf32c63d2ed21a0ab (patch)
tree7fed8086665efb8a08a504109c60c5f4b0cbc981
parent2b5c5c15f604e71e49e7aa243055a62a2fdb11d5 (diff)
downloadppe42-gcc-502cb098c4503722dac0fccbf32c63d2ed21a0ab.tar.gz
ppe42-gcc-502cb098c4503722dac0fccbf32c63d2ed21a0ab.zip
* method.c (use_thunk): Disable access control while building the
body of the thunk. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60889 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/method.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b6aef432de7..57a6f158e44 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-04 Mark Mitchell <mark@codesourcery.com>
+
+ * method.c (use_thunk): Disable access control while building the
+ body of the thunk.
+
2003-01-03 Nathanael Nerode <neroden@gcc.gnu.org>
* cvt.c, decl.c, decl2.c: This is the C++ front end, not the C
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 684f797ce9b..f4960b29c53 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -480,6 +480,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
doesn't work for varargs. */
tree a, t;
+ int saved_check_access;
if (varargs_function_p (function))
error ("generic thunk code fails for method `%#D' which uses `...'",
@@ -501,8 +502,11 @@ use_thunk (tree thunk_fndecl, bool emit_p)
start_function (NULL_TREE, thunk_fndecl, NULL_TREE, SF_PRE_PARSED);
/* We don't bother with a body block for thunks. */
+ /* There's no need to check accessibility inside the thunk body. */
+ saved_check_access = scope_chain->check_access;
+ scope_chain->check_access = 0;
+
t = a;
-
if (this_adjusting)
t = thunk_adjust (t, /*this_adjusting=*/1,
fixed_offset, virtual_offset);
@@ -529,6 +533,9 @@ use_thunk (tree thunk_fndecl, bool emit_p)
/* But we don't want debugging information about it. */
DECL_IGNORED_P (thunk_fndecl) = 1;
+ /* Re-enable access control. */
+ scope_chain->check_access = saved_check_access;
+
expand_body (finish_function (0));
}
OpenPOWER on IntegriCloud