summaryrefslogtreecommitdiff
path: root/codemaker
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-11 09:42:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-11 15:18:26 +0200
commitbb209f2f53edc1b0d268d561e0c12bf93e83fb41 (patch)
tree09ede9f9b8c8ff39c8b958fcf000580681ca59b1 /codemaker
parenta1949a419e2e4bec52906bb163b0cf510fe2aa14 (diff)
Revert "clang bugprone-unused-return-value"
comment from sberg: aren't these changes broken in general, when the called function may throw an exception before it takes ownership of the passed-in pointer? So revert, except for (a) PlainTextFilterDetect::detect, which was definitely a leak (b) SwCursor::FindAll, where unique_ptr was being unnecessarily used This reverts commit 7764ae70b04058a64a3999529e98d1115ba59d1c. Change-Id: I555e651b44e245b031729013d2ce88d26e8a357e Reviewed-on: https://gerrit.libreoffice.org/60301 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'codemaker')
-rw-r--r--codemaker/source/javamaker/javatype.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx
index 944f1a0aca9f..5530392b278b 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -764,7 +764,8 @@ void handleEnumType(
std::unique_ptr< ClassFile::Code > blockCode(cf->newCode());
blockCode->instrGetstatic(className, pair.second, classDescriptor);
blockCode->instrAreturn();
- blocks.push_back(blockCode.release());
+ blocks.push_back(blockCode.get());
+ blockCode.release();
}
code->instrTableswitch(defCode.get(), min, blocks);
for (ClassFile::Code *p : blocks)
@@ -782,7 +783,8 @@ void handleEnumType(
std::unique_ptr< ClassFile::Code > blockCode(cf->newCode());
blockCode->instrGetstatic(className, pair.second, classDescriptor);
blockCode->instrAreturn();
- blocks.emplace_back(pair.first, blockCode.release());
+ blocks.emplace_back(pair.first, blockCode.get());
+ blockCode.release();
}
code->instrLookupswitch(defCode.get(), blocks);
for (const std::pair< sal_Int32, ClassFile::Code * >& pair : blocks)