summaryrefslogtreecommitdiff
path: root/src/virtualmachine/Exceptions.h
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-09-13 09:14:08 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-09-13 09:14:08 (GMT)
commitacf652595c7df69adab683a5a9b29e3881cc42be (patch)
tree6f33500607edbfbf7503b87c28639a671366be59 /src/virtualmachine/Exceptions.h
parent771d5df5c9796bb5d6f6c4cae453b138dd17f192 (diff)
downloadpowder-acf652595c7df69adab683a5a9b29e3881cc42be.zip
powder-acf652595c7df69adab683a5a9b29e3881cc42be.tar.gz
Some progress on JIT - no syscalls yet
Diffstat (limited to 'src/virtualmachine/Exceptions.h')
-rw-r--r--src/virtualmachine/Exceptions.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/virtualmachine/Exceptions.h b/src/virtualmachine/Exceptions.h
index 2dca461..fbc4341 100644
--- a/src/virtualmachine/Exceptions.h
+++ b/src/virtualmachine/Exceptions.h
@@ -7,11 +7,16 @@ namespace vm
{
class RuntimeException: public std::exception
{
+ char * error;
public:
- RuntimeException() {}
+ RuntimeException() : error(NULL) {}
+ RuntimeException(char * message) : error(strdup(message)) {}
const char * what() const throw()
{
- return "VirtualMachine runtime exception";
+ if(error)
+ return error;
+ else
+ return "VirtualMachine runtime exception";
}
~RuntimeException() throw() {};
};
@@ -56,6 +61,21 @@ namespace vm
~AccessViolationException() throw() {};
};
+ class JITException: public RuntimeException
+ {
+ char * _what;
+ public:
+ JITException(const char * what2)
+ {
+ _what = strdup(what2);
+ }
+ const char * what() const throw()
+ {
+ return _what;
+ }
+ ~JITException() throw() {};
+ };
+
class OutOfMemoryException: public RuntimeException
{
public: