cmd/protoc-gen-go: revert Enum simplication

Go1.12 on GoLLVM with LLVM 9.0.0 has a bug where the simpler but
equivalent expression results in memory corruption.
Revert to the more complex expression to avoid breaking GoLLVM and
it is not worth waiting for a GoLLVM fix.

Change-Id: I8b42965ca9bd333deb8693021e7b22f966e13521
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/171463
Reviewed-by: Damien Neil <dneil@google.com>
diff --git a/internal/testprotos/test/test.pb.go b/internal/testprotos/test/test.pb.go
index 0ac6b8e..43b2bac 100644
--- a/internal/testprotos/test/test.pb.go
+++ b/internal/testprotos/test/test.pb.go
@@ -36,7 +36,9 @@
 }
 
 func (x ForeignEnum) Enum() *ForeignEnum {
-	return &x
+	p := new(ForeignEnum)
+	*p = x
+	return p
 }
 
 func (x ForeignEnum) String() string {
@@ -83,7 +85,9 @@
 }
 
 func (x TestReservedEnumFields) Enum() *TestReservedEnumFields {
-	return &x
+	p := new(TestReservedEnumFields)
+	*p = x
+	return p
 }
 
 func (x TestReservedEnumFields) String() string {
@@ -139,7 +143,9 @@
 }
 
 func (x TestAllTypes_NestedEnum) Enum() *TestAllTypes_NestedEnum {
-	return &x
+	p := new(TestAllTypes_NestedEnum)
+	*p = x
+	return p
 }
 
 func (x TestAllTypes_NestedEnum) String() string {
@@ -185,7 +191,9 @@
 }
 
 func (x TestDeprecatedMessage_DeprecatedEnum) Enum() *TestDeprecatedMessage_DeprecatedEnum {
-	return &x
+	p := new(TestDeprecatedMessage_DeprecatedEnum)
+	*p = x
+	return p
 }
 
 func (x TestDeprecatedMessage_DeprecatedEnum) String() string {
diff --git a/internal/testprotos/test/test_import.pb.go b/internal/testprotos/test/test_import.pb.go
index 6a5fc07..52af12d 100644
--- a/internal/testprotos/test/test_import.pb.go
+++ b/internal/testprotos/test/test_import.pb.go
@@ -30,7 +30,9 @@
 }
 
 func (x ImportEnum) Enum() *ImportEnum {
-	return &x
+	p := new(ImportEnum)
+	*p = x
+	return p
 }
 
 func (x ImportEnum) String() string {