From a63a6eb9bcd0465900f29bf9c7fd083f6f203952 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 21 Jul 2019 19:41:13 +0200 Subject: [PATCH] PVS V1022 throwing exceptions by pointer Change-Id: I0767da0be63a2955cc370ee81dc921cdf101285e Reviewed-on: https://review.haiku-os.org/c/1638 Reviewed-by: waddlesplash --- src/tools/gensyscalls/gensyscallinfos.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tools/gensyscalls/gensyscallinfos.cpp b/src/tools/gensyscalls/gensyscallinfos.cpp index cf82831459..b94a1dd84c 100644 --- a/src/tools/gensyscalls/gensyscallinfos.cpp +++ b/src/tools/gensyscalls/gensyscallinfos.cpp @@ -313,7 +313,7 @@ private: // open the input file ifstream file(filename, ifstream::in); if (!file.is_open()) - throw new IOException(string("Failed to open `") + filename + "'."); + throw IOException(string("Failed to open `") + filename + "'."); // parse the syscalls Tokenizer tokenizer(file); // find "#pragma syscalls begin" @@ -344,7 +344,7 @@ private: // open the syscall info file ofstream file(filename, ofstream::out | ofstream::trunc); if (!file.is_open()) - throw new IOException(string("Failed to open `") + filename + "'."); + throw IOException(string("Failed to open `") + filename + "'."); // write preamble file << "#include \"gensyscalls.h\"" << endl; @@ -410,7 +410,7 @@ private: // open the syscall info file ofstream file(filename, ofstream::out | ofstream::trunc); if (!file.is_open()) - throw new IOException(string("Failed to open `") + filename + "'."); + throw IOException(string("Failed to open `") + filename + "'."); // write preamble file << "#include " << endl; @@ -569,7 +569,7 @@ main(int argc, char** argv) { try { return Main().Run(argc, argv); - } catch (Exception& exception) { + } catch (const Exception& exception) { fprintf(stderr, "%s\n", exception.what()); return 1; }