mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-17 08:51:34 +00:00
Fix crash when assigning to bool class fields (#95)
With `Type.bool`, size is 1, so dividing by 8 isn't the right way to convert to byteSize. Instead, we need to use the `byteSize` property that does the proper ceiling division.
This commit is contained in:
committed by
Daniel Wirtz
parent
8997561670
commit
ce2bf00d62
@ -4411,7 +4411,7 @@ export class Compiler extends DiagnosticEmitter {
|
||||
return module.createBlock(null, [
|
||||
module.createSetLocal(tempLocalIndex, valueWithCorrectType),
|
||||
module.createStore(
|
||||
type.size >> 3,
|
||||
type.byteSize,
|
||||
thisExpr,
|
||||
module.createGetLocal(tempLocalIndex, nativeType),
|
||||
nativeType,
|
||||
@ -4421,7 +4421,7 @@ export class Compiler extends DiagnosticEmitter {
|
||||
], nativeType);
|
||||
} else {
|
||||
return module.createStore(
|
||||
type.size >> 3,
|
||||
type.byteSize,
|
||||
thisExpr,
|
||||
valueWithCorrectType,
|
||||
nativeType,
|
||||
|
Reference in New Issue
Block a user