Skip to content
This repository
Browse code

Missing NULL check on some normalization corner cases. Fixes #95

  • Loading branch information...
commit 2c2731598aac00589be3f525687e0b3d272ed7eb 1 parent 405dfaa
Marius Kintel kintel authored

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 src/csgtermnormalizer.cc
5 src/csgtermnormalizer.cc
@@ -44,9 +44,10 @@ shared_ptr<CSGTerm> CSGTermNormalizer::normalizePass(shared_ptr<CSGTerm> term)
44 44 do {
45 45 while (term && normalize_tail(term)) { }
46 46 if (!term || term->type == CSGTerm::TYPE_PRIMITIVE) return term;
47   - term->left = normalizePass(term->left);
  47 + if (term->left) term->left = normalizePass(term->left);
48 48 } while (term->type != CSGTerm::TYPE_UNION &&
49   - (term->right->type != CSGTerm::TYPE_PRIMITIVE || term->left->type == CSGTerm::TYPE_UNION));
  49 + (term->right && term->right->type != CSGTerm::TYPE_PRIMITIVE ||
  50 + term->left && term->left->type == CSGTerm::TYPE_UNION));
50 51 term->right = normalizePass(term->right);
51 52
52 53 // FIXME: Do we need to take into account any transformation of item here?

0 comments on commit 2c27315

Please sign in to comment.
Something went wrong with that request. Please try again.