This is an automated email from the ASF dual-hosted git repository.
jensg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git
The following commit(s) were added to refs/heads/master by this push:
new 7d30e2c (no ticket) catch exception by ref Patch: Gaurav Singh
7d30e2c is described below
commit 7d30e2c0b67ef14351d233ac8b29292ae2fbbd90
Author: Gaurav Singh <[email protected]>
AuthorDate: Sun Feb 2 10:56:26 2020 -0500
(no ticket) catch exception by ref
Patch: Gaurav Singh
This closes #1998
---
compiler/cpp/src/thrift/main.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/compiler/cpp/src/thrift/main.cc b/compiler/cpp/src/thrift/main.cc
index 03e0d6f..4c900f7 100644
--- a/compiler/cpp/src/thrift/main.cc
+++ b/compiler/cpp/src/thrift/main.cc
@@ -932,7 +932,7 @@ void parse(t_program* program, t_program* parent_program) {
if (yyparse() != 0) {
failure("Parser error during include pass.");
}
- } catch (string x) {
+ } catch (string &x) {
failure(x.c_str());
}
fclose(yyin);
@@ -970,7 +970,7 @@ void parse(t_program* program, t_program* parent_program) {
if (yyparse() != 0) {
failure("Parser error during types pass.");
}
- } catch (string x) {
+ } catch (string &x) {
failure(x.c_str());
}
fclose(yyin);
@@ -1014,7 +1014,7 @@ void generate(t_program* program, const vector<string>&
generator_strings) {
delete generator;
}
}
- } catch (string s) {
+ } catch (string &s) {
failure("Error: %s\n", s.c_str());
} catch (const char* exc) {
failure("Error: %s\n", exc);