OCamlPro / gnucobol

A clone of the sourceforge GnuCOBOL compiler from COBOL to C.
https://get-superbol.com
GNU Lesser General Public License v3.0
16 stars 21 forks source link

Exhibit issue with `memset` used to assign values that do not fit the picture string #74

Closed nberth closed 1 year ago

nberth commented 1 year ago

Note failure almost surely depends on the (version of the) C compiler.

codecov-commenter commented 1 year ago

Codecov Report

Merging #74 (36ec49a) into gcos4gnucobol-3.x (91b7781) will not change coverage. The diff coverage is n/a.

@@                Coverage Diff                 @@
##           gcos4gnucobol-3.x      #74   +/-   ##
==================================================
  Coverage              65.25%   65.25%           
==================================================
  Files                     34       34           
  Lines                  56281    56281           
  Branches               14729    14729           
==================================================
  Hits                   36724    36724           
  Misses                 13677    13677           
  Partials                5880     5880           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

GitMensch commented 1 year ago

Note failure almost surely depends on the (version of the) C compiler.

Yes, it does not fail on the CI or on gitpod (Ubuntu 20.04, default GCC) either. It may also depend on the warning options used.

Do you know if the same memset issue exists with 3.1.2 (because we changed code for that in between)? I'd guess that the issue in each case is in codegen.c, output_initialize_to_value, where the fields's size is not handled.

... ok, I've spot it in the code and will commit the fix along with your testcase.