summary refs log tree commit diff stats
path: root/compiler/vmops.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2024-08-11 22:13:26 +0800
committerGitHub <noreply@github.com>2024-08-11 16:13:26 +0200
commitb9b24e192aa25aedb175c9990869b6015e98a622 (patch)
treeb05077586125dfe2c741b431b8621291f7ecb595 /compiler/vmops.nim
parenta64aa51fe9b7a9dac63806ff77a75573079bdcbd (diff)
downloadNim-b9b24e192aa25aedb175c9990869b6015e98a622.tar.gz
fixes #23932; vmopsDanger for os.getCurrentDir errors (#23934)
fixes #23932
ref https://github.com/jmgomez/NimForUE/issues/36
Diffstat (limited to 'compiler/vmops.nim')
-rw-r--r--compiler/vmops.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/vmops.nim b/compiler/vmops.nim
index 23b41fd2e..45194e633 100644
--- a/compiler/vmops.nim
+++ b/compiler/vmops.nim
@@ -27,6 +27,7 @@ from std/envvars import getEnv, existsEnv, delEnv, putEnv, envPairs
 from std/os import getAppFilename
 from std/private/oscommon import dirExists, fileExists
 from std/private/osdirs import walkDir, createDir
+from std/private/ospaths2 import getCurrentDir
 
 from std/times import cpuTime
 from std/hashes import hash
@@ -341,8 +342,8 @@ proc registerAdditionalOps*(c: PCtx) =
     ## reproducible builds and users need to understand that this runs at CT.
     ## Note that `staticExec` can already do equal amount of damage so it's more
     ## of a semantic issue than a security issue.
-    registerCallback c, "stdlib.os.getCurrentDir", proc (a: VmArgs) {.nimcall.} =
-      setResult(a, os.getCurrentDir())
+    registerCallback c, "stdlib.ospaths2.getCurrentDir", proc (a: VmArgs) {.nimcall.} =
+      setResult(a, getCurrentDir())
     registerCallback c, "stdlib.osproc.execCmdEx", proc (a: VmArgs) {.nimcall.} =
       let options = getNode(a, 1).fromLit(set[osproc.ProcessOption])
       a.setResult osproc.execCmdEx(getString(a, 0), options).toLit