diff mbox

Go patch committed: Export and import of predeclared error type

Message ID mcr1usonmrb.fsf@dhcp-172-18-216-180.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Dec. 1, 2011, 6:57 p.m. UTC
This patch from Rémy Oudompheng fixes the export and import of the
predeclared error type.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

diff -r 2769c29f2014 go/export.cc
--- a/go/export.cc	Thu Dec 01 09:07:49 2011 -0800
+++ b/go/export.cc	Thu Dec 01 10:31:54 2011 -0800
@@ -337,6 +337,7 @@ 
   this->register_builtin_type(gogo, "uintptr", BUILTIN_UINTPTR);
   this->register_builtin_type(gogo, "bool", BUILTIN_BOOL);
   this->register_builtin_type(gogo, "string", BUILTIN_STRING);
+  this->register_builtin_type(gogo, "error", BUILTIN_ERROR);
 }
 
 // Register one builtin type in the export table.
diff -r 2769c29f2014 go/export.h
--- a/go/export.h	Thu Dec 01 09:07:49 2011 -0800
+++ b/go/export.h	Thu Dec 01 10:31:54 2011 -0800
@@ -39,8 +39,9 @@ 
   BUILTIN_STRING = -16,
   BUILTIN_COMPLEX64 = -17,
   BUILTIN_COMPLEX128 = -18,
+  BUILTIN_ERROR = -19,
 
-  SMALLEST_BUILTIN_CODE = -18
+  SMALLEST_BUILTIN_CODE = -19
 };
 
 // This class manages exporting Go declarations.  It handles the main
diff -r 2769c29f2014 go/import.cc
--- a/go/import.cc	Thu Dec 01 09:07:49 2011 -0800
+++ b/go/import.cc	Thu Dec 01 10:31:54 2011 -0800
@@ -706,6 +706,7 @@ 
   this->register_builtin_type(gogo, "uintptr", BUILTIN_UINTPTR);
   this->register_builtin_type(gogo, "bool", BUILTIN_BOOL);
   this->register_builtin_type(gogo, "string", BUILTIN_STRING);
+  this->register_builtin_type(gogo, "error", BUILTIN_ERROR);
 }
 
 // Register a single builtin type.