com.c (ffecom_arglist_expr_): Crash if non-supplied optional arg isn't passed as...
authorJeff Law <law@gcc.gnu.org>
Sun, 22 Feb 1998 19:26:46 +0000 (12:26 -0700)
committerJeff Law <law@gcc.gnu.org>
Sun, 22 Feb 1998 19:26:46 +0000 (12:26 -0700)
        * com.c (ffecom_arglist_expr_): Crash if non-supplied
        optional arg isn't passed as an address.
        Pass null pointer explicitly, instead of via ffecom routine.
        If incoming argstring is NULL, substitute pointer to "0".
        Recognize '0' as ending the usual arg stuff, just like '\0'.
        * com.c (ffecom_arglist_expr_): Pass null pointers for optional
        args which aren't supplied.
More patches from Craig.

From-SVN: r18183

gcc/f/ChangeLog
gcc/f/com.c

index bd3d47d5de4e608a65fd2a8b9ecf9d646a7c5467..f63413b0cbe9dcda541b4cf40649a0273819ca1d 100644 (file)
@@ -46,12 +46,24 @@ Mon Dec  1 19:12:36 1997  Craig Burley  <burley@gnu.org>
 
        * intrin.c (ffeintrin_check_): Fix up indentation a bit more.
 
+Mon Dec  1 16:21:08 1997  Craig Burley  <burley@gnu.org>
+
+       * com.c (ffecom_arglist_expr_): Crash if non-supplied
+       optional arg isn't passed as an address.
+       Pass null pointer explicitly, instead of via ffecom routine.
+       If incoming argstring is NULL, substitute pointer to "0".
+       Recognize '0' as ending the usual arg stuff, just like '\0'.
+
 Sun Nov 30 22:22:22 1997  Craig Burley  <burley@gnu.org>
 
        * intdoc.c: Minor fix-ups.
 
        * intrin.c (ffeintrin_check_): Fix up indentation a bit.
 
+1997-11-17  Dave Love  <d.love@dl.ac.uk>
+
+       * com.c (ffecom_arglist_expr_): Pass null pointers for optional
+       args which aren't supplied.
 
 Fri Oct 10 13:00:48 1997  Craig Burley  <burley@gnu.ai.mit.edu>
 
index 4d8e02611f4c86e54a8ecdb8126262986ac13a8d..63a8d27fee2de6b1b26c5d15e872d541dfae3a4f 100644 (file)
@@ -1093,6 +1093,10 @@ ffecom_arglist_expr_ (char *c, ffebld expr)
   tree item;
   bool ptr = FALSE;
   tree wanted = NULL_TREE;
+  static char zed[] = "0";
+
+  if (c == NULL)
+    c = &zed[0];
 
   while (expr != NULL)
     {
@@ -1185,6 +1189,39 @@ ffecom_arglist_expr_ (char *c, ffebld expr)
        }
     }
 
+  /* We've run out of args in the call; if the implementation expects
+     more, supply null pointers for them, which the implementation can
+     check to see if an arg was omitted. */
+
+  while (*c != '\0' && *c != '0')
+    {
+      if (*c == '&')
+       ++c;
+      else
+       assert ("missing arg to run-time routine!" == NULL);
+
+      switch (*(c++))
+       {
+       case '\0':
+       case 'a':
+       case 'c':
+       case 'd':
+       case 'e':
+       case 'f':
+       case 'i':
+       case 'j':
+         break;
+
+       default:
+         assert ("bad arg string code" == NULL);
+         break;
+       }
+      *plist
+       = build_tree_list (NULL_TREE,
+                          null_pointer_node);
+      plist = &TREE_CHAIN (*plist);
+    }
+
   *plist = trail;
 
   return list;