WebAssembly wat2wasm v1.0.32 allows attackers to cause a libc++abi.dylib crash by putting '@' before a quote (").
### Describe the bug

'@' before a quote (") causes a libc++abi.dylib crash while converting ".wat" format into ".wasm" format using wat2wasm.

`wat2wasm --version`: 1.0.32 (git~1.0.32-35-g9990b0cf)

---------------

The following minimized code causes wat2wasm to crash.

```
(module (memory $mem 1)
   ;;(@_memory " (memory $mem)) ;; Space in between '@' and '"' avoids crash
   ;; A comment below the next line containing a '"' will also avoid a crash
   (@_memory" (memory $mem))
   (func
    $main
    (export "_main")
    (result i32)
    i32.const 21))

```

Absolute minimum example:

```
(@"
```
---------------
###  Steps to reproduce:

Here are the test files: (Remove ".txt" and save them ".wat" files)
[wabt_crash.wat.txt](https://github.com/WebAssembly/wabt/files/10936843/wabt_crash.wat.txt)

[wabt_crash_min.wat.txt](https://github.com/WebAssembly/wabt/files/10936844/wabt_crash_min.wat.txt)


* Install and build WABT

* Run wat2wasm on the test file: `wat2wasm wabt_crash.wat` and `wat2wasm wabt_crash_min.wat`

* Observe the crash:

  ```
  libc++abi.dylib: terminating with uncaught exception of type std::length_error: basic_string
  [1]    4522 abort      wat2wasm wabt_crash.wat
  ```

  

---------------
### Expected Behavior:

Expected output should be an error (like the one below) produced by ` wat2wasm` instead of a crash.
For example, if the test file replaces the '@' with a '*', `wat2wasm` gives the expected error below when run with `wat2wasm expected.wat`, which points out the missing end quote.

```
expected.wat:4:29: error: newline in string
   (*_memory" (memory $mem))
                            ^
expected.wat:5:9: error: newline in string
   (func
        ^
expected.wat:6:10: error: newline in string
    $main
         ^
expected.wat:7:21: error: newline in string
    (export "_main")
                    ^
expected.wat:8:17: error: newline in string
    (result i32)
                ^
expected.wat:9:19: error: newline in string
    i32.const 21))
                  ^
expected.wat:4:4: error: unexpected token (, expected ).
   (*_memory" (memory $mem))

```


---------------------

### Additional information

A combination of afl-fuzz++4.03a and Wasmlike, an Xsmith-based random program generator produced the snippet of code that caused the crash. https://www.flux.utah.edu/project/xsmith

---------------
'@' before a quote (") causes a libc++abi.dylib crash using wat2wasm.
This is a GitHub Issue
repo:wabt
owner:WebAssembly
Title : '@' before a quote (") causes a libc++abi.dylib crash using wat2wasm.
Issue date:

--- start body ---
### Describe the bug

'@' before a quote (") causes a libc++abi.dylib crash while converting ".wat" format into ".wasm" format using wat2wasm.

`wat2wasm --version`: 1.0.32 (git~1.0.32-35-g9990b0cf)

---------------

The following minimized code causes wat2wasm to crash.

```
(module (memory $mem 1)
   ;;(@_memory " (memory $mem)) ;; Space in between '@' and '"' avoids crash
   ;; A comment below the next line containing a '"' will also avoid a crash
   (@_memory" (memory $mem))
   (func
    $main
    (export "_main")
    (result i32)
    i32.const 21))

```

Absolute minimum example:

```
(@"
```
---------------
###  Steps to reproduce:

Here are the test files: (Remove ".txt" and save them ".wat" files)
[wabt_crash.wat.txt](https://github.com/WebAssembly/wabt/files/10936843/wabt_crash.wat.txt)

[wabt_crash_min.wat.txt](https://github.com/WebAssembly/wabt/files/10936844/wabt_crash_min.wat.txt)


* Install and build WABT

* Run wat2wasm on the test file: `wat2wasm wabt_crash.wat` and `wat2wasm wabt_crash_min.wat`

* Observe the crash:

  ```
  libc++abi.dylib: terminating with uncaught exception of type std::length_error: basic_string
  [1]    4522 abort      wat2wasm wabt_crash.wat
  ```

  

---------------
### Expected Behavior:

Expected output should be an error (like the one below) produced by ` wat2wasm` instead of a crash.
For example, if the test file replaces the '@' with a '*', `wat2wasm` gives the expected error below when run with `wat2wasm expected.wat`, which points out the missing end quote.

```
expected.wat:4:29: error: newline in string
   (*_memory" (memory $mem))
                            ^
expected.wat:5:9: error: newline in string
   (func
        ^
expected.wat:6:10: error: newline in string
    $main
         ^
expected.wat:7:21: error: newline in string
    (export "_main")
                    ^
expected.wat:8:17: error: newline in string
    (result i32)
                ^
expected.wat:9:19: error: newline in string
    i32.const 21))
                  ^
expected.wat:4:4: error: unexpected token (, expected ).
   (*_memory" (memory $mem))

```


---------------------

### Additional information

A combination of afl-fuzz++4.03a and Wasmlike, an Xsmith-based random program generator produced the snippet of code that caused the crash. https://www.flux.utah.edu/project/xsmith

---------------
--- end body ---
