aboutsummaryrefslogtreecommitdiffstats
path: root/community/binaryen/fix-gcc8-wcatch-value.patch
blob: 445afc96f3cb12fe403fc783e7e58dc3bea019d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Made from https://github.com/WebAssembly/binaryen/pull/1400

Should probably just be removed when the package version is bumped.

- Daniel Isaksen <d@duniel.no>

diff --git a/src/tools/asm2wasm.cpp b/src/tools/asm2wasm.cpp
index 3f70e0388e..cecae7a819 100644
--- a/src/tools/asm2wasm.cpp
+++ b/src/tools/asm2wasm.cpp
@@ -87,7 +87,7 @@ int main(int argc, const char *argv[]) {
            [&trapMode](Options *o, const std::string &argument) {
              try {
                trapMode = trapModeFromString(argument);
-             } catch (std::invalid_argument e) {
+             } catch (std::invalid_argument& e) {
                std::cerr << "Error: " << e.what() << "\n";
                exit(EXIT_FAILURE);
              }
diff --git a/src/tools/s2wasm.cpp b/src/tools/s2wasm.cpp
index 6e7b2c05e2..3643993b7f 100644
--- a/src/tools/s2wasm.cpp
+++ b/src/tools/s2wasm.cpp
@@ -92,7 +92,7 @@ int main(int argc, const char *argv[]) {
            [&trapMode](Options *o, const std::string &argument) {
              try {
                trapMode = trapModeFromString(argument);
-             } catch (std::invalid_argument e) {
+             } catch (std::invalid_argument& e) {
                std::cerr << "Error: " << e.what() << "\n";
                exit(EXIT_FAILURE);
              }
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp
index 0de3edf3f6..78a150f814 100644
--- a/src/wasm/wasm-s-parser.cpp
+++ b/src/wasm/wasm-s-parser.cpp
@@ -1408,9 +1408,9 @@ Name SExpressionWasmBuilder::getLabel(Element& s) {
     uint64_t offset;
     try {
       offset = std::stoll(s.c_str(), nullptr, 0);
-    } catch (std::invalid_argument) {
+    } catch (std::invalid_argument&) {
       throw ParseException("invalid break offset");
-    } catch (std::out_of_range) {
+    } catch (std::out_of_range&) {
       throw ParseException("out of range break offset");
     }
     if (offset > nameMapper.labelStack.size()) throw ParseException("invalid label", s.line, s.col);