Problem with signed 32bits PMEM #525
This commit is contained in:
parent
c1ba0d1389
commit
c419c5297d
|
@ -561,11 +561,11 @@ static duk_ret_t duk_pmem(duk_context* duk)
|
|||
|
||||
if(index < TIC_PERSISTENT_SIZE)
|
||||
{
|
||||
s32 val = memory->persistent.data[index];
|
||||
u32 val = memory->persistent.data[index];
|
||||
|
||||
if(!duk_is_null_or_undefined(duk, 1))
|
||||
{
|
||||
memory->persistent.data[index] = duk_to_int(duk, 1);
|
||||
memory->persistent.data[index] = duk_to_uint(duk, 1);
|
||||
machine->data->syncPMEM = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1064,11 +1064,11 @@ static s32 lua_pmem(lua_State *lua)
|
|||
|
||||
if(index < TIC_PERSISTENT_SIZE)
|
||||
{
|
||||
s32 val = memory->persistent.data[index];
|
||||
u32 val = memory->persistent.data[index];
|
||||
|
||||
if(top >= 2)
|
||||
{
|
||||
memory->persistent.data[index] = getLuaNumber(lua, 2);
|
||||
memory->persistent.data[index] = lua_tointeger(lua, 2);
|
||||
machine->data->syncPMEM = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -401,7 +401,7 @@ typedef union
|
|||
|
||||
typedef struct
|
||||
{
|
||||
s32 data[TIC_PERSISTENT_SIZE];
|
||||
u32 data[TIC_PERSISTENT_SIZE];
|
||||
} tic_persistent;
|
||||
|
||||
typedef union
|
||||
|
|
|
@ -900,7 +900,7 @@ static void wren_pmem(WrenVM* vm)
|
|||
|
||||
if(index < TIC_PERSISTENT_SIZE)
|
||||
{
|
||||
s32 val = memory->persistent.data[index];
|
||||
u32 val = memory->persistent.data[index];
|
||||
|
||||
if(top > 2)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue