Will Coleda wrote:
> The following opcodes return 'PerlUndef' on failure, instead of 'Undef' or 
> null.
> 
> open, socket, fdopen, dlfunc, dlvar, find_global

Patch attached that changes all these to Undef.

-- 
Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]>
Perl and Parrot hacker

There is no cabal.
? patch.txt
Index: ops/core.ops
===================================================================
RCS file: /cvs/public/parrot/ops/core.ops,v
retrieving revision 1.377
diff -u -r1.377 core.ops
--- ops/core.ops        25 Nov 2004 11:15:20 -0000      1.377
+++ ops/core.ops        27 Nov 2004 07:29:41 -0000
@@ -1134,7 +1134,7 @@
       const char * err = Parrot_dlerror();
       Parrot_warn(interpreter, PARROT_WARNINGS_UNDEF_FLAG,
         "Symbol '%s' not found: %s\n", name, err ? err : "unkown reason");
-      $1 = pmc_new(interpreter, enum_class_PerlUndef);
+      $1 = pmc_new(interpreter, enum_class_Undef);
   }
   else {
       $1 = pmc_new(interpreter, enum_class_NCI);
@@ -1152,7 +1152,7 @@
       const char * err = Parrot_dlerror();
       Parrot_warn(interpreter, PARROT_WARNINGS_UNDEF_FLAG,
         "Symbol '%s' not found: %s\n", name, err ? err : "unkown reason");
-      $1 = pmc_new(interpreter, enum_class_PerlUndef);
+      $1 = pmc_new(interpreter, enum_class_Undef);
   }
   else {
       /* At this point we have the symbol's address. We just need to build
Index: ops/io.ops
===================================================================
RCS file: /cvs/public/parrot/ops/io.ops,v
retrieving revision 1.51
diff -u -r1.51 io.ops
--- ops/io.ops  29 Sep 2004 15:44:29 -0000      1.51
+++ ops/io.ops  27 Nov 2004 07:29:41 -0000
@@ -58,7 +58,7 @@
 
   $1 = PIO_fdopen(interpreter, NULL, (PIOHANDLE)$2, mode);
   if (!$1) {
-    $1 = pmc_new(interpreter, enum_class_PerlUndef);
+    $1 = pmc_new(interpreter, enum_class_Undef);
   }
   /* string_cstring_free(mode); */
   /* TODO all results from string_to_cstring() need freeing
@@ -155,7 +155,7 @@
   /* string_cstring_free(mode); */
   /* string_cstring_free(path); */
   if(!$1 || !PMC_struct_val($1)) {
-    $1 = pmc_new(interpreter, enum_class_PerlUndef);
+    $1 = pmc_new(interpreter, enum_class_Undef);
   }
   goto NEXT();
 }
@@ -169,7 +169,7 @@
   $1 = PIO_open(interpreter, NULL, path, "+<");
   /* string_cstring_free(path); */
   if(!$1) {
-    $1 = pmc_new(interpreter, enum_class_PerlUndef);
+    $1 = pmc_new(interpreter, enum_class_Undef);
   }
   goto NEXT();
 }
@@ -526,7 +526,7 @@
 op socket(out PMC, in INT, in INT, in INT) :base_network {
   $1 = PIO_socket(interpreter, $2, $3, $4);
   if(!$1) {
-    $1 = pmc_new(interpreter, enum_class_PerlUndef);
+    $1 = pmc_new(interpreter, enum_class_Undef);
   }
   goto NEXT();
 }
Index: ops/var.ops
===================================================================
RCS file: /cvs/public/parrot/ops/var.ops,v
retrieving revision 1.21
diff -u -r1.21 var.ops
--- ops/var.ops 6 Aug 2004 12:23:55 -0000       1.21
+++ ops/var.ops 27 Nov 2004 07:29:41 -0000
@@ -330,7 +330,7 @@
                    "Global '%Ss' not found\n", $3);
        }
        else {
-           stash = pmc_new(interpreter, enum_class_PerlUndef);
+           stash = pmc_new(interpreter, enum_class_Undef);
            VTABLE_set_pmc_keyed(interpreter, globals, $2, stash);
        }
     }
@@ -343,7 +343,7 @@
                    "Global '%Ss' not found\n", $3);
        }
        else {
-           $1 = pmc_new(interpreter, enum_class_PerlUndef);
+           $1 = pmc_new(interpreter, enum_class_Undef);
        }
     }
     else {

Reply via email to