summaryrefslogtreecommitdiff
path: root/dev-lang/perl/files/perl-5.26.2-hppa.patch
blob: 83ed944353e513f2e2321d8d2218a5d43293cfa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
https://bugs.gentoo.org/634162

Source:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=869122

Index: perl-5.26.0/op.c
===================================================================
--- perl-5.26.0.orig/op.c
+++ perl-5.26.0/op.c
@@ -14832,6 +14832,7 @@ Perl_custom_op_get_field(pTHX_ const OP
     SV *keysv;
     HE *he = NULL;
     XOP *xop;
+    XOPRETANY any;
 
     static const XOP xop_null = { 0, 0, 0, 0, 0 };
 
@@ -14874,58 +14875,37 @@ Perl_custom_op_get_field(pTHX_ const OP
 	else
 	    xop = INT2PTR(XOP *, SvIV(HeVAL(he)));
     }
-    {
-	XOPRETANY any;
-	if(field == XOPe_xop_ptr) {
-	    any.xop_ptr = xop;
-	} else {
-	    const U32 flags = XopFLAGS(xop);
-	    if(flags & field) {
-		switch(field) {
-		case XOPe_xop_name:
-		    any.xop_name = xop->xop_name;
-		    break;
-		case XOPe_xop_desc:
-		    any.xop_desc = xop->xop_desc;
-		    break;
-		case XOPe_xop_class:
-		    any.xop_class = xop->xop_class;
-		    break;
-		case XOPe_xop_peep:
-		    any.xop_peep = xop->xop_peep;
-		    break;
-		default:
-		    NOT_REACHED; /* NOTREACHED */
-		    break;
-		}
-	    } else {
-		switch(field) {
-		case XOPe_xop_name:
-		    any.xop_name = XOPd_xop_name;
-		    break;
-		case XOPe_xop_desc:
-		    any.xop_desc = XOPd_xop_desc;
-		    break;
-		case XOPe_xop_class:
-		    any.xop_class = XOPd_xop_class;
-		    break;
-		case XOPe_xop_peep:
-		    any.xop_peep = XOPd_xop_peep;
-		    break;
-		default:
-		    NOT_REACHED; /* NOTREACHED */
-		    break;
-		}
-	    }
+
+    if(field == XOPe_xop_ptr) {
+        any.xop_ptr = xop;
+    } else {
+        const U32 flags = XopFLAGS(xop);
+        switch(field) {
+        case XOPe_xop_name:
+            any.xop_name = (flags & field) ? xop->xop_name : XOPd_xop_name;
+            break;
+        case XOPe_xop_desc:
+            any.xop_desc = (flags & field) ? xop->xop_desc : XOPd_xop_desc;
+            break;
+        case XOPe_xop_class:
+            any.xop_class = (flags & field) ? xop->xop_class : XOPd_xop_class;
+            break;
+        case XOPe_xop_peep:
+            any.xop_peep = (flags & field) ? xop->xop_peep : XOPd_xop_peep;
+            break;
+        default:
+            NOT_REACHED; /* NOTREACHED */
+            break;
 	}
-        /* On some platforms (HP-UX, IA64) gcc emits a warning for this function:
-         * op.c: In function 'Perl_custom_op_get_field':
-         * op.c:...: warning: 'any.xop_name' may be used uninitialized in this function [-Wmaybe-uninitialized]
-         * This is because on those platforms (with -DEBUGGING) NOT_REACHED
-         * expands to assert(0), which expands to ((0) ? (void)0 :
-         * __assert(...)), and gcc doesn't know that __assert can never return. */
-	return any;
     }
+
+    /* On some platforms (HP-UX, IA64) gcc emits a warning for this function:
+     * op.c: In function 'Perl_custom_op_get_field':
+     * op.c:...: warning: 'any.xop_name' may be used uninitialized in this function [-Wmaybe-uninitialized]
+     * This is because on those platforms (with -DEBUGGING) NOT_REACHED
+     * expands to assert(0), which expands to ((0) ? (void)0 :
+     * __assert(...)), and gcc doesn't know that __assert can never return. */
+    return any;
 }
 
 /*