From 0cc72ac2d9d2b29d0e167c836105d8dd44af0b9f Mon Sep 17 00:00:00 2001 From: ktkk Date: Mon, 6 Jul 2026 09:52:42 +0000 Subject: [PATCH] Remove this_class and super_class verification The plan is to implement a separate "verify" function that is separate from parsing or formatting. --- src/Class.zig | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/Class.zig b/src/Class.zig index 58c02d1..d244335 100644 --- a/src/Class.zig +++ b/src/Class.zig @@ -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); } +