Assembler (#6)
Co-authored-by: Andre Wagner <WagnerAndre@JohnDeere.com> Reviewed-on: https://192.168.5.48/andre/tyche/pulls/6
This commit was merged in pull request #6.
This commit is contained in:
15
src/bytecode/bc_exceptions.hh
Normal file
15
src/bytecode/bc_exceptions.hh
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef TYCHE_BC_EXCEPTIONS_HH
|
||||
#define TYCHE_BC_EXCEPTIONS_HH
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
namespace tyche::bc {
|
||||
|
||||
class BytecodeParsingError : public std::runtime_error {
|
||||
public:
|
||||
explicit BytecodeParsingError(std::string const& str) : std::runtime_error(str.c_str()) {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //TYCHE_BC_EXCEPTIONS_HH
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "bytecode.hh"
|
||||
|
||||
#include "bc_exceptions.hh"
|
||||
#include "../common/overloaded.hh"
|
||||
|
||||
namespace tyche::bc {
|
||||
|
||||
@@ -14,7 +14,7 @@ struct BytecodePrototype {
|
||||
struct Function {
|
||||
uint16_t n_pars;
|
||||
uint16_t n_locals;
|
||||
ByteArray code;
|
||||
ByteArray code {};
|
||||
|
||||
Function(uint16_t n_pars_, uint16_t n_locals_) : n_pars(n_pars_), n_locals(n_locals_), code(ByteArray {}) {}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user