diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2001-06-10 21:50:40 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2001-06-10 21:50:40 +0000 |
commit | eb2d06144aede2d0cef5e937b2f4c40b30d35ead (patch) | |
tree | 1396453b3b2771e2974d1322a5e5ef0659e74c95 | |
parent | 9b8c19b4f52afaace7b003100311a4ebf4180a13 (diff) | |
download | gcc-eb2d06144aede2d0cef5e937b2f4c40b30d35ead.zip gcc-eb2d06144aede2d0cef5e937b2f4c40b30d35ead.tar.gz gcc-eb2d06144aede2d0cef5e937b2f4c40b30d35ead.tar.bz2 |
typeck.c (get_member_function_from_ptrfunc): Don't clobber delta.
* typeck.c (get_member_function_from_ptrfunc) [vbit_in_delta]:
Don't clobber delta.
(expand_ptrmemfunc_cst) [ptrmemfunc_vbit_in_delta]: Adjust pfn.
From-SVN: r43156
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f452720..02fb550 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2001-06-10 Alexandre Oliva <aoliva@redhat.com> + + * typeck.c (get_member_function_from_ptrfunc) [vbit_in_delta]: + Don't clobber delta. + (expand_ptrmemfunc_cst) [ptrmemfunc_vbit_in_delta]: Adjust pfn. + 2001-06-10 Mark Mitchell <mark@codesourcery.com> Gabriel Dos Reis <gdr@codesourcery.com> diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 3c2ea8d..38deeee 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -2937,9 +2937,6 @@ get_member_function_from_ptrfunc (instance_ptrptr, function) abort (); } - delta = cp_convert (ptrdiff_type_node, - build_component_ref (function, delta_identifier, - NULL_TREE, 0)); /* DELTA2 is the amount by which to adjust the `this' pointer to find the vtbl. */ delta2 = delta; @@ -6175,12 +6172,12 @@ expand_ptrmemfunc_cst (cst, delta, pfn) ptrmemfunc_vbit_in_delta, in which case delta is shifted left, and then incremented). */ *pfn = DECL_VINDEX (fn); + *pfn = fold (build (MULT_EXPR, integer_type_node, *pfn, + TYPE_SIZE_UNIT (vtable_entry_type))); switch (TARGET_PTRMEMFUNC_VBIT_LOCATION) { case ptrmemfunc_vbit_in_pfn: - *pfn = fold (build (MULT_EXPR, integer_type_node, *pfn, - TYPE_SIZE_UNIT (vtable_entry_type))); *pfn = fold (build (PLUS_EXPR, integer_type_node, *pfn, integer_one_node)); break; |