maxLocals calculation
This commit is contained in:
parent
d2554c9b22
commit
ee302bb245
@ -69,18 +69,19 @@ methodAssembler (MethodDeclaration returntype name parameters statement) input =
|
||||
in case (splitAt index (methods input)) of
|
||||
(pre, []) -> input
|
||||
(pre, method : post) -> let
|
||||
(_, bytecode, _) = assembleMethod (constantPool input, [], paramNames) declaration
|
||||
(constants, bytecode, aParamNames) = assembleMethod (constantPool input, [], paramNames) declaration
|
||||
assembledMethod = method {
|
||||
memberAttributes = [
|
||||
CodeAttribute {
|
||||
attributeMaxStack = 420,
|
||||
attributeMaxLocals = 420,
|
||||
attributeMaxLocals = fromIntegral $ length aParamNames,
|
||||
attributeCode = bytecode
|
||||
}
|
||||
]
|
||||
}
|
||||
in
|
||||
input {
|
||||
constantPool = constants,
|
||||
methods = pre ++ (assembledMethod : post)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user