From 18f5307ce9472e05b2c0e55195691bf17c469673 Mon Sep 17 00:00:00 2001 From: Daniel Green Date: Fri, 11 Nov 2022 10:59:01 -0500 Subject: [PATCH 1/2] Bump MoarVM for unsigned chown args --- tools/templates/MOAR_REVISION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/templates/MOAR_REVISION b/tools/templates/MOAR_REVISION index 938cdfa48..b2bb6fa87 100644 --- a/tools/templates/MOAR_REVISION +++ b/tools/templates/MOAR_REVISION @@ -1 +1 @@ -2022.07-18-gd22223381 +2022.07-20-g757524899 From 37b976df38dccc19fdd77606203b10a03db09f25 Mon Sep 17 00:00:00 2001 From: Daniel Green Date: Fri, 11 Nov 2022 10:59:03 -0500 Subject: [PATCH 2/2] nqp::chown args should be unsigned --- docs/ops.markdown | 2 +- src/vm/js/Operations.nqp | 2 +- src/vm/jvm/QAST/Compiler.nqp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/ops.markdown b/docs/ops.markdown index dbe780b90..75cfbaf72 100644 --- a/docs/ops.markdown +++ b/docs/ops.markdown @@ -1521,7 +1521,7 @@ Change the permissions of `$path` to the posix style permissions of `$mode`. Returns 0 on success, throws an exception on failure. ## chown -* `chown(str $path, int $uid, int $gid --> int)` +* `chown(str $path, uint $uid, uint $gid --> int)` Change the owner or group of the path. Throws an exception on failure. diff --git a/src/vm/js/Operations.nqp b/src/vm/js/Operations.nqp index 668c56403..682ed1c1a 100644 --- a/src/vm/js/Operations.nqp +++ b/src/vm/js/Operations.nqp @@ -576,7 +576,7 @@ class QAST::OperationsJS { add_simple_op('mkdir', $T_VOID, [$T_STR, $T_INT], :side_effects); add_simple_op('chmod', $T_VOID, [$T_STR, $T_INT], :side_effects); - add_simple_op('chown', $T_VOID, [$T_STR, $T_INT, $T_INT], :side_effects); + add_simple_op('chown', $T_VOID, [$T_STR, $T_UINT, $T_UINT], :side_effects); add_simple_op('getenvhash', $T_OBJ, [], :side_effects); add_simple_op('getsignals', $T_OBJ, [], :side_effects, :takes_hll); diff --git a/src/vm/jvm/QAST/Compiler.nqp b/src/vm/jvm/QAST/Compiler.nqp index cff6a6fdc..37d33d551 100644 --- a/src/vm/jvm/QAST/Compiler.nqp +++ b/src/vm/jvm/QAST/Compiler.nqp @@ -2270,7 +2270,7 @@ QAST::OperationsJAST.map_classlib_core_op('filenofh', $TYPE_OPS, 'filenofh', [$R QAST::OperationsJAST.map_classlib_core_op('setbuffersizefh', $TYPE_OPS, 'setbuffersizefh', [$RT_OBJ, $RT_INT], $RT_OBJ, :tc); QAST::OperationsJAST.map_classlib_core_op('chmod', $TYPE_OPS, 'chmod', [$RT_STR, $RT_INT], $RT_INT, :tc); -QAST::OperationsJAST.map_classlib_core_op('chown', $TYPE_OPS, 'chown', [$RT_STR, $RT_INT, $RT_INT], $RT_INT, :tc); +QAST::OperationsJAST.map_classlib_core_op('chown', $TYPE_OPS, 'chown', [$RT_STR, $RT_UINT, $RT_UINT], $RT_INT, :tc); QAST::OperationsJAST.map_classlib_core_op('unlink', $TYPE_OPS, 'unlink', [$RT_STR], $RT_INT, :tc); QAST::OperationsJAST.map_classlib_core_op('rmdir', $TYPE_OPS, 'rmdir', [$RT_STR], $RT_INT, :tc); QAST::OperationsJAST.map_classlib_core_op('cwd', $TYPE_OPS, 'cwd', [], $RT_STR);