We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2dfd90 commit c70dbf0Copy full SHA for c70dbf0
lib/Sema/TypeCheckMacros.cpp
@@ -214,8 +214,9 @@ Expr *swift::expandMacroExpr(
214
215
// Create a new source buffer with the contents of the expanded macro.
216
auto macroBuffer =
217
- llvm::MemoryBuffer::getMemBuffer(evaluatedSource, bufferName);
+ llvm::MemoryBuffer::getMemBufferCopy(evaluatedSource, bufferName);
218
unsigned macroBufferID = sourceMgr.addNewSourceBuffer(std::move(macroBuffer));
219
+ free((void*)evaluatedSource.data());
220
221
// Create a source file to hold the macro buffer. This is automatically
222
// registered with the enclosing module.
0 commit comments