Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wasm-watermarker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
wasm-watermarker
Commits
e5319c9b
Commit
e5319c9b
authored
Jul 07, 2019
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: Read the input module
parent
5baa09bc
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
9 deletions
+48
-9
README.md
README.md
+1
-1
add.wast
example/add.wast
+19
-0
CMakeLists.txt
src/CMakeLists.txt
+4
-3
kyut.cpp
src/kyut.cpp
+0
-5
snpi.cpp
src/snpi.cpp
+24
-0
No files found.
README.md
View file @
e5319c9b
...
...
@@ -32,6 +32,6 @@ $ make
## 実行方法
```
shell
$
kyut
<input-wasm> <watermark>
$
snpi
<input-wasm> <watermark>
$
pisn <input-wasm>
```
example/add.wast
0 → 100644
View file @
e5319c9b
(module
(export "add2" (func $add2))
(export "add3" (func $add3))
(func $add2 (param $a i32) (param $b i32) (result i32)
(i32.add
(local.get $a)
(local.get $b)
)
)
(func $add3 (param $a i32) (param $b i32) (param $c i32) (result i32)
(i32.add
(i32.add
(local.get $a)
(local.get $b)
)
(local.get $c)
)
)
)
src/CMakeLists.txt
View file @
e5319c9b
...
...
@@ -6,10 +6,11 @@
# fmt::fmt
# )
add_executable
(
kyut
kyut
.cpp
add_executable
(
snpi
snpi
.cpp
)
target_link_libraries
(
kyut
target_link_libraries
(
snpi
binaryen::binaryen
fmt::fmt
)
src/kyut.cpp
deleted
100644 → 0
View file @
5baa09bc
#include <fmt/printf.h>
int
main
()
{
fmt
::
print
(
"Hello, {}
\n
"
,
"kyut"
);
}
src/snpi.cpp
0 → 100644
View file @
e5319c9b
#include <fmt/printf.h>
#include <wasm-io.h>
int
main
(
int
argc
,
char
*
argv
[])
{
// Parse command line options
if
(
argc
!=
2
)
{
fmt
::
print
(
std
::
cerr
,
"{} <input file>
\n
"
,
argv
[
0
]);
return
1
;
}
const
std
::
string
inputFile
=
argv
[
1
];
try
{
// Read the input module
wasm
::
Module
module
;
wasm
::
ModuleReader
{}.
read
(
inputFile
,
module
);
}
catch
(
const
wasm
::
ParseException
&
e
)
{
e
.
dump
(
std
::
cerr
);
}
catch
(...)
{
fmt
::
print
(
std
::
cerr
,
"unknown exception
\n
"
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment