File: r1649.patch

package info (click to toggle)
aspectc%2B%2B 1%3A2.3-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 18,708 kB
  • sloc: cpp: 108,813; ansic: 7,644; sh: 2,262; makefile: 1,303; pascal: 634; python: 402; xml: 349
file content (33 lines) | stat: -rw-r--r-- 1,204 bytes parent folder | download
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
From: Olaf Spinczyk
Subject: Fixed segfault on 32 bit machines
Origin: upstream

$  svn log -c r1649
------------------------------------------------------------------------
r1649 | olaf | 2021-02-19 15:10:26 -0500 (Fri, 19 Feb 2021) | 1 line

Fixed segfault on 32 bit machines, which was caused by a bug in the pointcut expression evaluation for attributes. The parent node of the root scope is not NULL.

--- a/AspectC++/PointCutExpr.cc
+++ b/AspectC++/PointCutExpr.cc
@@ -1194,6 +1194,10 @@
       }
     }

+    // if we have just checked the root scope, break here, because it has no parent
+    if (jpl_name == context.jpm().get_root())
+      break;
+
     // otherwise check the parent scope of the current name join point,
     // but omit the parent classes of nested classes
     ACM_Name *parent = (ACM_Name*)jpl_name->get_parent();
@@ -1201,9 +1205,6 @@
       while (parent && (parent->type_val () == JPT_Class || parent->type_val () == JPT_Aspect))
         parent = (ACM_Name*)parent->get_parent();
     }
-    // root scope detected -> stop here
-    if (!parent || parent == context.jpm().get_root())
-      break;

     // continue by matching the parent scope
     jpl_name = parent;