Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions JSImpl/test/sprtTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,12 @@ TEST_F(SPRTTest, Call)
OpCodes::PushFrom, 4, // 20
OpCodes::Call, 25, // 22
OpCodes::Print, 4, // 24
OpCodes::Halt, // 25
OpCodes::Halt, // 25
OpCodes::Print, 0, // 27
OpCodes::Print, -1, // 29
OpCodes::Print, -2, // 31
OpCodes::Mul, 1, -2, -1,// 33
OpCodes::Ret, 1, // 35
OpCodes::Print, Spasm::byte(-1), // 29
OpCodes::Print, Spasm::byte(-2), // 31
OpCodes::Mul, 1, Spasm::byte(-2), Spasm::byte(-1), // 33
OpCodes::Ret, 1, // 35
};

Run(bytecode, sizeof(bytecode));
Expand Down
2 changes: 1 addition & 1 deletion spasm/src/asm/bytecode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ASM
class Bytecode_Stream
{
public:
typedef int8_t byte;
typedef uint8_t byte;
typedef byte Opcode_t;

virtual ~Bytecode_Stream();
Expand Down
2 changes: 1 addition & 1 deletion spasm/src/spasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ int64_t Spasm::read_integer(size_t size)
switch (size)
{
case 0:
return m_ByteCode[m_PC++];
return *reinterpret_cast<int8_t*>(&m_ByteCode[m_PC++]);
case 1:
{
auto result = *reinterpret_cast<int16_t*>(&m_ByteCode[0] + m_PC);
Expand Down
2 changes: 1 addition & 1 deletion spasm/src/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace SpasmImpl
{
typedef int8_t byte;
typedef uint8_t byte;
typedef size_t PC_t;
typedef Spasm::Value data_t;

Expand Down