slackbuilds/graphics/brlcad/fix-step-g-segfault.diff

71 lines
2.8 KiB
Diff

diff -Naur brlcad-7.32.4/src/other/stepcode/src/clstepcore/complexSupport.h brlcad-7.32.4.patched/src/other/stepcode/src/clstepcore/complexSupport.h
--- brlcad-7.32.4/src/other/stepcode/src/clstepcore/complexSupport.h 2021-07-28 23:11:47.000000000 -0400
+++ brlcad-7.32.4.patched/src/other/stepcode/src/clstepcore/complexSupport.h 2022-02-25 17:42:27.909342186 -0500
@@ -208,26 +208,26 @@
// but all we need.
EntList * firstNot( JoinType );
EntList * nextNot( JoinType j ) {
- return next->firstNot( j );
+ return (next) ? next->firstNot(j) : NULL;
}
EntList * firstWanted( MatchType );
EntList * nextWanted( MatchType mat ) {
- return next->firstWanted( mat );
+ return (next) ? next->firstWanted(mat) : NULL;
}
EntList * lastNot( JoinType );
EntList * prevNot( JoinType j ) {
- return prev->lastNot( j );
+ return (prev) ? prev->lastNot(j) : NULL;
}
EntList * lastWanted( MatchType );
EntList * prevWanted( MatchType mat ) {
- return prev->lastWanted( mat );
+ return (prev) ? prev->lastWanted(mat) : NULL;
}
JoinType join;
int multiple() {
return ( join != SIMPLE );
}
- EntList * next, *prev;
+ EntList * next = NULL, *prev = NULL;
protected:
MatchType viable;
diff -Naur brlcad-7.32.4/src/other/stepcode/src/exp2cxx/complexSupport.h brlcad-7.32.4.patched/src/other/stepcode/src/exp2cxx/complexSupport.h
--- brlcad-7.32.4/src/other/stepcode/src/exp2cxx/complexSupport.h 2021-07-28 23:11:48.000000000 -0400
+++ brlcad-7.32.4.patched/src/other/stepcode/src/exp2cxx/complexSupport.h 2022-02-25 17:40:52.465760163 -0500
@@ -162,26 +162,26 @@
// but all we need.
EntList * firstNot( JoinType );
EntList * nextNot( JoinType j ) {
- return next->firstNot( j );
+ return (next) ? next->firstNot(j) : NULL;
}
EntList * firstWanted( MatchType );
EntList * nextWanted( MatchType mat ) {
- return next->firstWanted( mat );
+ return (next) ? next->firstWanted(mat) : NULL;
}
EntList * lastNot( JoinType );
EntList * prevNot( JoinType j ) {
- return prev->lastNot( j );
+ return (prev) ? prev->lastNot(j) : NULL;
}
EntList * lastWanted( MatchType );
EntList * prevWanted( MatchType mat ) {
- return prev->lastWanted( mat );
+ return (prev) ? prev->lastWanted(mat) : NULL;
}
JoinType join;
int multiple() {
return ( join != SIMPLE );
}
- EntList * next, *prev;
+ EntList * next = NULL, *prev = NULL;
protected:
MatchType viable;