fix-step-g-segfault.diff 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. 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
  2. --- brlcad-7.32.4/src/other/stepcode/src/clstepcore/complexSupport.h 2021-07-28 23:11:47.000000000 -0400
  3. +++ brlcad-7.32.4.patched/src/other/stepcode/src/clstepcore/complexSupport.h 2022-02-25 17:42:27.909342186 -0500
  4. @@ -208,26 +208,26 @@
  5. // but all we need.
  6. EntList * firstNot( JoinType );
  7. EntList * nextNot( JoinType j ) {
  8. - return next->firstNot( j );
  9. + return (next) ? next->firstNot(j) : NULL;
  10. }
  11. EntList * firstWanted( MatchType );
  12. EntList * nextWanted( MatchType mat ) {
  13. - return next->firstWanted( mat );
  14. + return (next) ? next->firstWanted(mat) : NULL;
  15. }
  16. EntList * lastNot( JoinType );
  17. EntList * prevNot( JoinType j ) {
  18. - return prev->lastNot( j );
  19. + return (prev) ? prev->lastNot(j) : NULL;
  20. }
  21. EntList * lastWanted( MatchType );
  22. EntList * prevWanted( MatchType mat ) {
  23. - return prev->lastWanted( mat );
  24. + return (prev) ? prev->lastWanted(mat) : NULL;
  25. }
  26. JoinType join;
  27. int multiple() {
  28. return ( join != SIMPLE );
  29. }
  30. - EntList * next, *prev;
  31. + EntList * next = NULL, *prev = NULL;
  32. protected:
  33. MatchType viable;
  34. 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
  35. --- brlcad-7.32.4/src/other/stepcode/src/exp2cxx/complexSupport.h 2021-07-28 23:11:48.000000000 -0400
  36. +++ brlcad-7.32.4.patched/src/other/stepcode/src/exp2cxx/complexSupport.h 2022-02-25 17:40:52.465760163 -0500
  37. @@ -162,26 +162,26 @@
  38. // but all we need.
  39. EntList * firstNot( JoinType );
  40. EntList * nextNot( JoinType j ) {
  41. - return next->firstNot( j );
  42. + return (next) ? next->firstNot(j) : NULL;
  43. }
  44. EntList * firstWanted( MatchType );
  45. EntList * nextWanted( MatchType mat ) {
  46. - return next->firstWanted( mat );
  47. + return (next) ? next->firstWanted(mat) : NULL;
  48. }
  49. EntList * lastNot( JoinType );
  50. EntList * prevNot( JoinType j ) {
  51. - return prev->lastNot( j );
  52. + return (prev) ? prev->lastNot(j) : NULL;
  53. }
  54. EntList * lastWanted( MatchType );
  55. EntList * prevWanted( MatchType mat ) {
  56. - return prev->lastWanted( mat );
  57. + return (prev) ? prev->lastWanted(mat) : NULL;
  58. }
  59. JoinType join;
  60. int multiple() {
  61. return ( join != SIMPLE );
  62. }
  63. - EntList * next, *prev;
  64. + EntList * next = NULL, *prev = NULL;
  65. protected:
  66. MatchType viable;