loganoz / horses3d

HORSES3D: A high-order discontinuous Galerkin solver for flow simulations and multi-physics applications
https://loganoz.github.io/horses3d/
MIT License
106 stars 23 forks source link

Fix intermediate integer overflow when reading/writing large files #224

Closed TRPrasanna closed 2 months ago

TRPrasanna commented 3 months ago

fixed issue with intermediate integer overflow when writing files exceeding 2 GB

see here : #223

TRPrasanna commented 2 months ago

I just realized that overflow can happen at more places, basically wherever the variable offsetIO is multiplied by other integers. So I multiplied these terms with 1_AddrInt wherever this variable exists on the right hand side of any relevant expression, so that the product is promoted to type AddrInt. These were only in 2 more lines (line 3081 and 3377, in addition to the first commit for line 2981).