Remove this_class and super_class verification
The plan is to implement a separate "verify" function that is separate from parsing or formatting.
This commit is contained in:
parent
cb43efcbb1
commit
0cc72ac2d9
1 changed files with 2 additions and 16 deletions
|
|
@ -265,20 +265,6 @@ pub fn thisClass(self: *const Self) ResolveError!ConstantPool.Info {
|
|||
}
|
||||
|
||||
pub fn superClass(self: *const Self) ResolveError!?ConstantPool.Info {
|
||||
if (self.super_class == 0) {
|
||||
const this_class = (try self.thisClass()).class;
|
||||
const this_class_name = (try this_class.name(self.constant_pool)).utf8;
|
||||
if (!std.mem.eql(u8, this_class_name.bytes, "java/lang/Object")) return ResolveError.InvalidConstantType;
|
||||
return null;
|
||||
} else {
|
||||
const super_class = try self.constant_pool.getTag(self.super_class, .class);
|
||||
|
||||
if (self.access_flags.contains(.interface)) {
|
||||
const super_class_name = (try super_class.class.name(self.constant_pool)).utf8;
|
||||
if (!std.mem.eql(u8, super_class_name.bytes, "java/lang/Object")) return ResolveError.InvalidConstantType;
|
||||
} else {
|
||||
// TODO: Assert that superclass does not have ACC_FINAL flag set.
|
||||
}
|
||||
return super_class;
|
||||
}
|
||||
return self.constant_pool.getTagOptional(self.super_class, .class);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue