Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

54 lines (40 sloc) 0.982 kB
#ifndef RBX_BYTECODE_VERIFICATION
#define RBX_BYTECODE_VERIFICATION
#include <stdint.h>
#include <list>
namespace rubinius {
class CompiledMethod;
class VM;
class Tuple;
class BytecodeVerification {
CompiledMethod* method_;
Tuple* ops_;
native_int total_;
int max_stack_allowed_;
int max_stack_seen_;
int32_t* stack_;
native_int locals_;
int max_stack_local_;
const char* fail_reason_;
int fail_ip_;
void fail(const char* reason, int ip) {
fail_reason_ = reason;
fail_ip_ = ip;
}
struct Section {
int sp;
int ip;
Section(int sp, int ip)
: sp(sp), ip(ip)
{}
};
public:
BytecodeVerification(CompiledMethod* cm);
~BytecodeVerification();
bool verify(VM* state);
bool verify_from(VM* state, int sp, int ip, std::list<Section>& ips);
const char* failure_reason() { return fail_reason_; }
int failure_ip() { return fail_ip_; }
};
}
#endif
Jump to Line
Something went wrong with that request. Please try again.