@@ -233,7 +233,7 @@ func Test_fdFdstatGet(t *testing.T) {
233
233
file , dir := "animals.txt" , "sub"
234
234
mod , r , log := requireProxyModule (t , wazero .NewModuleConfig ().WithFS (fstest .FS ))
235
235
defer r .Close (testCtx )
236
- memorySize := mod .Memory ().Size ()
236
+ memorySize := uint32 ( mod .Memory ().Size () )
237
237
238
238
// open both paths without using WASI
239
239
fsc := mod .(* wasm.ModuleInstance ).Sys .FS ()
@@ -659,7 +659,7 @@ func Test_fdFilestatGet(t *testing.T) {
659
659
file , dir := "animals.txt" , "sub"
660
660
mod , r , log := requireProxyModule (t , wazero .NewModuleConfig ().WithFS (fstest .FS ))
661
661
defer r .Close (testCtx )
662
- memorySize := mod .Memory ().Size ()
662
+ memorySize := uint32 ( mod .Memory ().Size () )
663
663
664
664
// open both paths without using WASI
665
665
fsc := mod .(* wasm.ModuleInstance ).Sys .FS ()
@@ -1397,7 +1397,7 @@ func Test_fdPrestatGet_Errors(t *testing.T) {
1397
1397
mod , dirFD , log , r := requireOpenFile (t , t .TempDir (), "tmp" , nil , true )
1398
1398
defer r .Close (testCtx )
1399
1399
1400
- memorySize := mod .Memory ().Size ()
1400
+ memorySize := uint32 ( mod .Memory ().Size () )
1401
1401
tests := []struct {
1402
1402
name string
1403
1403
fd int32
@@ -1477,7 +1477,7 @@ func Test_fdPrestatDirName_Errors(t *testing.T) {
1477
1477
mod , dirFD , log , r := requireOpenFile (t , t .TempDir (), "tmp" , nil , true )
1478
1478
defer r .Close (testCtx )
1479
1479
1480
- memorySize := mod .Memory ().Size ()
1480
+ memorySize := uint32 ( mod .Memory ().Size () )
1481
1481
maskMemory (t , mod , 10 )
1482
1482
1483
1483
validAddress := uint32 (0 ) // Arbitrary valid address as arguments to fd_prestat_dir_name. We chose 0 here.
@@ -2304,7 +2304,7 @@ func Test_fdReaddir_Rewind(t *testing.T) {
2304
2304
func Test_fdReaddir_Errors (t * testing.T ) {
2305
2305
mod , r , log := requireProxyModule (t , wazero .NewModuleConfig ().WithFS (fstest .FS ))
2306
2306
defer r .Close (testCtx )
2307
- memLen := mod .Memory ().Size ()
2307
+ memLen := uint32 ( mod .Memory ().Size () )
2308
2308
2309
2309
fsc := mod .(* wasm.ModuleInstance ).Sys .FS ()
2310
2310
preopen := fsc .RootFS ()
@@ -2640,7 +2640,7 @@ func Test_fdSeek_Errors(t *testing.T) {
2640
2640
require .Zero (t , fsc .RootFS ().Mkdir ("dir" , 0o0777 ))
2641
2641
dirFD := requireOpenFD (t , mod , "dir" )
2642
2642
2643
- memorySize := mod .Memory ().Size ()
2643
+ memorySize := uint32 ( mod .Memory ().Size () )
2644
2644
2645
2645
tests := []struct {
2646
2646
name string
@@ -2791,7 +2791,7 @@ func Test_fdTell_Errors(t *testing.T) {
2791
2791
mod , fd , log , r := requireOpenFile (t , t .TempDir (), "test_path" , []byte ("wazero" ), true )
2792
2792
defer r .Close (testCtx )
2793
2793
2794
- memorySize := mod .Memory ().Size ()
2794
+ memorySize := uint32 ( mod .Memory ().Size () )
2795
2795
2796
2796
tests := []struct {
2797
2797
name string
@@ -2888,7 +2888,7 @@ func Test_fdWrite_Errors(t *testing.T) {
2888
2888
2889
2889
// Setup valid test memory
2890
2890
iovsCount := uint32 (1 )
2891
- memSize := mod .Memory ().Size ()
2891
+ memSize := uint32 ( mod .Memory ().Size () )
2892
2892
2893
2893
tests := []struct {
2894
2894
name string
@@ -3058,7 +3058,7 @@ func Test_pathCreateDirectory_Errors(t *testing.T) {
3058
3058
{
3059
3059
name : "out-of-memory reading path" ,
3060
3060
fd : sys .FdPreopen ,
3061
- path : mod .Memory ().Size (),
3061
+ path : uint32 ( mod .Memory ().Size () ),
3062
3062
pathLen : 1 ,
3063
3063
expectedErrno : wasip1 .ErrnoFault ,
3064
3064
expectedLog : `
@@ -3070,7 +3070,7 @@ func Test_pathCreateDirectory_Errors(t *testing.T) {
3070
3070
name : "out-of-memory reading pathLen" ,
3071
3071
fd : sys .FdPreopen ,
3072
3072
path : 0 ,
3073
- pathLen : mod .Memory ().Size () + 1 , // path is in the valid memory range, but pathLen is OOM for path
3073
+ pathLen : uint32 ( mod .Memory ().Size () ) + 1 , // path is in the valid memory range, but pathLen is OOM for path
3074
3074
expectedErrno : wasip1 .ErrnoFault ,
3075
3075
expectedLog : `
3076
3076
==> wasi_snapshot_preview1.path_create_directory(fd=3,path=OOM(0,65537))
@@ -3126,7 +3126,7 @@ func Test_pathFilestatGet(t *testing.T) {
3126
3126
3127
3127
mod , r , log := requireProxyModule (t , wazero .NewModuleConfig ().WithFS (fstest .FS ))
3128
3128
defer r .Close (testCtx )
3129
- memorySize := mod .Memory ().Size ()
3129
+ memorySize := uint32 ( mod .Memory ().Size () )
3130
3130
3131
3131
fileFD := requireOpenFD (t , mod , file )
3132
3132
@@ -4078,7 +4078,7 @@ func Test_pathOpen_Errors(t *testing.T) {
4078
4078
{
4079
4079
name : "out-of-memory reading path" ,
4080
4080
fd : sys .FdPreopen ,
4081
- path : mod .Memory ().Size (),
4081
+ path : uint32 ( mod .Memory ().Size () ),
4082
4082
pathLen : uint32 (len (file )),
4083
4083
expectedErrno : wasip1 .ErrnoFault ,
4084
4084
expectedLog : `
@@ -4090,7 +4090,7 @@ func Test_pathOpen_Errors(t *testing.T) {
4090
4090
name : "out-of-memory reading pathLen" ,
4091
4091
fd : sys .FdPreopen ,
4092
4092
path : 0 ,
4093
- pathLen : mod .Memory ().Size () + 1 , // path is in the valid memory range, but pathLen is OOM for path
4093
+ pathLen : uint32 ( mod .Memory ().Size () ) + 1 , // path is in the valid memory range, but pathLen is OOM for path
4094
4094
expectedErrno : wasip1 .ErrnoFault ,
4095
4095
expectedLog : `
4096
4096
==> wasi_snapshot_preview1.path_open(fd=3,dirflags=,path=OOM(0,65537),oflags=,fs_rights_base=,fs_rights_inheriting=,fdflags=)
@@ -4163,7 +4163,7 @@ func Test_pathOpen_Errors(t *testing.T) {
4163
4163
pathName : dir ,
4164
4164
path : 0 ,
4165
4165
pathLen : uint32 (len (dir )),
4166
- resultOpenedFd : mod .Memory ().Size (), // path and pathLen correctly point to the right path, but where to write the opened FD is outside memory.
4166
+ resultOpenedFd : uint32 ( mod .Memory ().Size () ), // path and pathLen correctly point to the right path, but where to write the opened FD is outside memory.
4167
4167
expectedErrno : wasip1 .ErrnoFault ,
4168
4168
expectedLog : `
4169
4169
==> wasi_snapshot_preview1.path_open(fd=3,dirflags=,path=dir,oflags=,fs_rights_base=,fs_rights_inheriting=,fdflags=)
@@ -4416,7 +4416,7 @@ func Test_pathRemoveDirectory_Errors(t *testing.T) {
4416
4416
{
4417
4417
name : "out-of-memory reading path" ,
4418
4418
fd : sys .FdPreopen ,
4419
- path : mod .Memory ().Size (),
4419
+ path : uint32 ( mod .Memory ().Size () ),
4420
4420
pathLen : 1 ,
4421
4421
expectedErrno : wasip1 .ErrnoFault ,
4422
4422
expectedLog : `
@@ -4428,7 +4428,7 @@ func Test_pathRemoveDirectory_Errors(t *testing.T) {
4428
4428
name : "out-of-memory reading pathLen" ,
4429
4429
fd : sys .FdPreopen ,
4430
4430
path : 0 ,
4431
- pathLen : mod .Memory ().Size () + 1 , // path is in the valid memory range, but pathLen is OOM for path
4431
+ pathLen : uint32 ( mod .Memory ().Size () ) + 1 , // path is in the valid memory range, but pathLen is OOM for path
4432
4432
expectedErrno : wasip1 .ErrnoFault ,
4433
4433
expectedLog : `
4434
4434
==> wasi_snapshot_preview1.path_remove_directory(fd=3,path=OOM(0,65537))
@@ -4682,7 +4682,7 @@ func Test_pathRename_Errors(t *testing.T) {
4682
4682
name : "out-of-memory reading old path" ,
4683
4683
oldFd : sys .FdPreopen ,
4684
4684
newFd : sys .FdPreopen ,
4685
- oldPath : mod .Memory ().Size (),
4685
+ oldPath : uint32 ( mod .Memory ().Size () ),
4686
4686
oldPathLen : 1 ,
4687
4687
expectedErrno : wasip1 .ErrnoFault ,
4688
4688
expectedLog : `
@@ -4697,7 +4697,7 @@ func Test_pathRename_Errors(t *testing.T) {
4697
4697
oldPath : 0 ,
4698
4698
oldPathName : "a" ,
4699
4699
oldPathLen : 1 ,
4700
- newPath : mod .Memory ().Size (),
4700
+ newPath : uint32 ( mod .Memory ().Size () ),
4701
4701
newPathLen : 1 ,
4702
4702
expectedErrno : wasip1 .ErrnoFault ,
4703
4703
expectedLog : `
@@ -4710,7 +4710,7 @@ func Test_pathRename_Errors(t *testing.T) {
4710
4710
oldFd : sys .FdPreopen ,
4711
4711
newFd : sys .FdPreopen ,
4712
4712
oldPath : 0 ,
4713
- oldPathLen : mod .Memory ().Size () + 1 , // path is in the valid memory range, but pathLen is OOM for path
4713
+ oldPathLen : uint32 ( mod .Memory ().Size () ) + 1 , // path is in the valid memory range, but pathLen is OOM for path
4714
4714
expectedErrno : wasip1 .ErrnoFault ,
4715
4715
expectedLog : `
4716
4716
==> wasi_snapshot_preview1.path_rename(fd=3,old_path=OOM(0,65537),new_fd=3,new_path=)
@@ -4724,7 +4724,7 @@ func Test_pathRename_Errors(t *testing.T) {
4724
4724
oldPathName : file ,
4725
4725
oldPathLen : uint32 (len (file )),
4726
4726
newPath : 0 ,
4727
- newPathLen : mod .Memory ().Size () + 1 , // path is in the valid memory range, but pathLen is OOM for path
4727
+ newPathLen : uint32 ( mod .Memory ().Size () ) + 1 , // path is in the valid memory range, but pathLen is OOM for path
4728
4728
expectedErrno : wasip1 .ErrnoFault ,
4729
4729
expectedLog : `
4730
4730
==> wasi_snapshot_preview1.path_rename(fd=3,old_path=file,new_fd=3,new_path=OOM(0,65537))
@@ -4853,7 +4853,7 @@ func Test_pathUnlinkFile_Errors(t *testing.T) {
4853
4853
{
4854
4854
name : "out-of-memory reading path" ,
4855
4855
fd : sys .FdPreopen ,
4856
- path : mod .Memory ().Size (),
4856
+ path : uint32 ( mod .Memory ().Size () ),
4857
4857
pathLen : 1 ,
4858
4858
expectedErrno : wasip1 .ErrnoFault ,
4859
4859
expectedLog : `
@@ -4865,7 +4865,7 @@ func Test_pathUnlinkFile_Errors(t *testing.T) {
4865
4865
name : "out-of-memory reading pathLen" ,
4866
4866
fd : sys .FdPreopen ,
4867
4867
path : 0 ,
4868
- pathLen : mod .Memory ().Size () + 1 , // path is in the valid memory range, but pathLen is OOM for path
4868
+ pathLen : uint32 ( mod .Memory ().Size () ) + 1 , // path is in the valid memory range, but pathLen is OOM for path
4869
4869
expectedErrno : wasip1 .ErrnoFault ,
4870
4870
expectedLog : `
4871
4871
==> wasi_snapshot_preview1.path_unlink_file(fd=3,path=OOM(0,65537))
0 commit comments