WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit a6ff7b64 authored by Kunshan Wang's avatar Kunshan Wang
Browse files

Re-apply the "charpp" fix to this branch.

parents 938280e1 b2aac66b
......@@ -86,6 +86,13 @@ class MicroVM(val vmConf: VMConf) {
globalBundle.constantNs.add(c)
constantPool.addGlobalVar(c)
}
// Some types required by the RunMu class
for (ty <- Seq(C_INT, C_CHAR, C_CHARP, C_CHARPP)) {
globalBundle.typeNs.add(ty)
}
}
/**
......
......@@ -13,6 +13,7 @@ import java.io.BufferedReader
import uvm.refimpl.nat.NativeSupport
import uvm.refimpl.nat.PlatformConstants
import uvm.refimpl.HowToResume.PassValues
import uvm.refimpl.InternalTypes
/** Run Mu from the command line. */
object RunMu {
......@@ -110,7 +111,7 @@ object RunMu {
val func = ctx.handleFromFunc(id)
val stack = ctx.newStack(func)
val hArgc = ctx.handleFromInt(argc, 32)
val hArgv = ctx.handleFromPtr(ctx.idOf("@charpp"), cArgv.address())
val hArgv = ctx.handleFromPtr(InternalTypes.C_CHARPP.id, cArgv.address())
val thread = ctx.newThread(stack, None, PassValues(Seq(hArgc, hArgv)))
}
......
......@@ -17,6 +17,11 @@ object InternalTypes {
val n = "@uvm.internal.types." + name
(id, n)
}
val C_INT = TypeInt(32) := internal("c_int")
val C_CHAR = TypeInt(8) := internal("c_char")
val C_CHARP = TypeUPtr(C_CHAR) := internal("c_charp")
val C_CHARPP = TypeUPtr(C_CHARP) := internal("c_charpp")
val I1 = TypeInt(1) := internal("i1")
val I6 = TypeInt(6) := internal("i6")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment