fix: close fp

This commit is contained in:
Enrico Lumetti 2022-05-08 00:34:59 +02:00
parent a65b94e483
commit a78851c220
2 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,7 @@ local opcodes = require('opcodes')
fp = io.open('tests/test1.luo')
header = readbc.read_header(fp)
proto = readbc.read_proto(fp)
fp:close()
for i = 1, #proto.bcins do
local decoded = opcodes.decode(proto.bcins[i])

View File

@ -3,4 +3,6 @@ local readbc = require('readbc')
fp = io.open('tests/test1.luo')
header = readbc.read_header(fp)
proto = readbc.read_proto(fp)
fo:close()
print(#proto.bcins)