diff options
| author | Dj <43033058+DjDeveloperr@users.noreply.github.com> | 2023-04-01 09:26:02 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-01 09:26:02 +0530 |
| commit | c162647020c26de1d27064b488ca11525f1bc4bf (patch) | |
| tree | 12709a19c838e4a00b65e334dc74e983ace0f0c2 /ext/ffi | |
| parent | bafffa95a08765085ab0bb43732d268038a46630 (diff) | |
fix(ext/ffi): crash when same reference struct is used in two fields (#18531)
fix #17482
Diffstat (limited to 'ext/ffi')
| -rw-r--r-- | ext/ffi/00_ffi.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/ffi/00_ffi.js b/ext/ffi/00_ffi.js index c7ca21975..3664ae73b 100644 --- a/ext/ffi/00_ffi.js +++ b/ext/ffi/00_ffi.js @@ -313,8 +313,9 @@ function getTypeSizeAndAlignment(type, cache = new SafeMap()) { size += fieldSize; } size = MathCeil(size / alignment) * alignment; - cache.set(type, size); - return [size, alignment]; + const result = [size, alignment]; + cache.set(type, result); + return result; } switch (type) { |
