[PATCH] Fix memory leak for APValues that do memory allocation.

Richard Smith richard at metafoo.co.uk
Fri May 10 13:44:28 PDT 2013



================
Comment at: lib/AST/APValue.cpp:235-240
@@ +234,8 @@
+    return getComplexFloatReal().needsCleanup();
+  case ComplexInt:
+    assert(!getComplexIntReal().needsCleanup() &&
+           "_Complex cannot be created with large enough real values.");
+    assert(!getComplexIntImag().needsCleanup() &&
+           "_Complex cannot be created with large enough real values.");
+    return false;
+  case LValue:
----------------
This seems likely to bite us in the future. Please implement this "properly" rather than asserting, even though it can't happen today.


http://llvm-reviews.chandlerc.com/D736

BRANCH
  memory-leak

ARCANIST PROJECT
  clang



More information about the cfe-commits mailing list