File tree Expand file tree Collapse file tree 4 files changed +37
-2
lines changed
Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Original file line number Diff line number Diff line change 11Extism /host.wasm
2+ Extism /unreachable.wasm
23Extism /MYMETA.json
34Extism /MYMETA.yml
45Extism /Makefile
@@ -17,3 +18,9 @@ examples/Extism-AudioDecoder/*.wav
1718examples /Extism-AudioDecoder /* .pcm
1819examples /Extism-AudioDecoder /.vscode
1920examples /CountVowels /.vscode
21+ Alien-libextism /MYMETA.json
22+ Alien-libextism /MYMETA.yml
23+ Alien-libextism /Makefile
24+ Alien-libextism /_alien /
25+ Alien-libextism /blib /
26+ Alien-libextism /pm_to_blib
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ use Extism ':all';
77use JSON::PP qw( encode_json decode_json) ;
88use File::Temp qw( tempfile) ;
99use Devel::Peek qw( Dump) ;
10- plan tests => 40 ;
10+ plan tests => 44 ;
1111
1212# ...
1313ok(Extism::version());
@@ -180,3 +180,18 @@ ok($decoded[1]{total} == 6);
180180# Verify both sets of results are the same
181181is($highlevel [0], $lowlevel [0]);
182182is($highlevel [1], $lowlevel [1]);
183+
184+ # test unreachable plugin
185+ my $unreachable = encode_json({
186+ wasm => [
187+ {
188+ path => ' unreachable.wasm' ,
189+ }
190+ ],
191+ });
192+ my $uplugin = Extism::Plugin-> new($unreachable , {wasi => 1});
193+ ok($uplugin );
194+ my ($ures , $urc , $uinfo ) = $uplugin -> call(' do_unreachable' );
195+ ok(!defined $ures );
196+ ok($urc != 0);
197+ ok($uinfo );
Original file line number Diff line number Diff line change 11.PHONY : all
2- all : Extism Extism/host.wasm
2+ all : Extism Extism/host.wasm Extism/unreachable.wasm
33
44Extism/host.wasm : host.c
55 $(WASI_SDK_PATH ) /bin/clang -o $@ $^ -mexec-model=reactor
66
7+ Extism/unreachable.wasm : unreachable.cpp
8+ $(WASI_SDK_PATH ) /bin/clang++ -fno-exceptions -o $@ $^ -mexec-model=reactor
9+
710Extism/Makefile : Extism/Makefile.PL
811 cd Extism && perl Makefile.PL
912.PHONY : Extism
Original file line number Diff line number Diff line change 1+ // #define EXTISM_IMPLEMENTATION
2+ #include " extism-pdk.h"
3+ #include < stdexcept>
4+ #include < stdint.h>
5+
6+ int32_t EXTISM_EXPORTED_FUNCTION (do_unreachable)
7+ {
8+ std::terminate ();
9+ return -1 ;
10+ }
You can’t perform that action at this time.
0 commit comments