aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2001-07-26 08:12:00 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2001-07-26 08:12:00 +0000
commit648c220695b109476bae09a887821030f78bcaa1 (patch)
treee6f10ddb69d08eece6d7288bbbc9dd76a7d3f282 /gcc/cp
parent969fd501d60879e8cb717bc6be07ad39e5067f18 (diff)
downloadgcc-648c220695b109476bae09a887821030f78bcaa1.zip
gcc-648c220695b109476bae09a887821030f78bcaa1.tar.gz
gcc-648c220695b109476bae09a887821030f78bcaa1.tar.bz2
re PR c++/3624 (Internal error: Segmentation fault)
cp: PR c++/3624 * call.c (resolve_args): Simplify, call convert_from_reference. (build_new_op): Resolve and convert from reference ARG1 earlier. Adjust ARG2 & ARG3 resolve and conversion. testsuite: * g++.old-deja/g++.pt/crash68.C: New test. From-SVN: r44388
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/call.c37
2 files changed, 30 insertions, 15 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 70c9bd3..949dd82 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,13 @@
2001-07-26 Nathan Sidwell <nathan@codesourcery.com>
+ PR c++/3624
+ * call.c (resolve_args): Simplify, call
+ convert_from_reference.
+ (build_new_op): Resolve and convert from reference ARG1
+ earlier. Adjust ARG2 & ARG3 resolve and conversion.
+
+2001-07-26 Nathan Sidwell <nathan@codesourcery.com>
+
* decl.c (last_function_parm_tags): Remove.
(current_function_parm_tags): Remove.
(init_decl_processing): Adjust.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 268cc27..bbe6c48 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -2556,15 +2556,19 @@ resolve_args (args)
tree t;
for (t = args; t; t = TREE_CHAIN (t))
{
- if (TREE_VALUE (t) == error_mark_node)
+ tree arg = TREE_VALUE (t);
+
+ if (arg == error_mark_node)
return error_mark_node;
- else if (TREE_CODE (TREE_TYPE (TREE_VALUE (t))) == VOID_TYPE)
+ else if (VOID_TYPE_P (TREE_TYPE (arg)))
{
error ("invalid use of void expression");
return error_mark_node;
}
- else if (TREE_CODE (TREE_VALUE (t)) == OFFSET_REF)
- TREE_VALUE (t) = resolve_offset_ref (TREE_VALUE (t));
+ else if (TREE_CODE (arg) == OFFSET_REF)
+ arg = resolve_offset_ref (arg);
+ arg = convert_from_reference (arg);
+ TREE_VALUE (t) = arg;
}
return args;
}
@@ -3220,6 +3224,10 @@ build_new_op (code, flags, arg1, arg2, arg3)
else
fnname = ansi_opname (code);
+ if (TREE_CODE (arg1) == OFFSET_REF)
+ arg1 = resolve_offset_ref (arg1);
+ arg1 = convert_from_reference (arg1);
+
switch (code)
{
case NEW_EXPR:
@@ -3236,19 +3244,18 @@ build_new_op (code, flags, arg1, arg2, arg3)
break;
}
- /* The comma operator can have void args. */
- if (TREE_CODE (arg1) == OFFSET_REF)
- arg1 = resolve_offset_ref (arg1);
- if (arg2 && TREE_CODE (arg2) == OFFSET_REF)
- arg2 = resolve_offset_ref (arg2);
- if (arg3 && TREE_CODE (arg3) == OFFSET_REF)
- arg3 = resolve_offset_ref (arg3);
-
- arg1 = convert_from_reference (arg1);
if (arg2)
- arg2 = convert_from_reference (arg2);
+ {
+ if (TREE_CODE (arg2) == OFFSET_REF)
+ arg2 = resolve_offset_ref (arg2);
+ arg2 = convert_from_reference (arg2);
+ }
if (arg3)
- arg3 = convert_from_reference (arg3);
+ {
+ if (TREE_CODE (arg3) == OFFSET_REF)
+ arg3 = resolve_offset_ref (arg3);
+ arg3 = convert_from_reference (arg3);
+ }
if (code == COND_EXPR)
{