MMIX LOGO

MMIX Bug Report calloc

Table of Content

Content

MMIXware Version

mmix-20231125

Bug Reported

Initial: 30/07/2024

Author

Andreas Scherer

Description

The invocation of calloc in section 26 of module MMIX-CONFIG isn't checked for failure. There should be a check against return value NULL and an appropriate panic message.

From my analysis, this is the single remaining call of calloc without a failure check.

Proposed Patch

@x [26] l.11
  funit[j].co=(coroutine*)calloc(n,sizeof(coroutine));
@y
  funit[j].co=(coroutine*)calloc(n,sizeof(coroutine));
  if (!funit[j].co) panic(errprint1("Can't allocate coroutine %d",j));
@z

Status

Fixed in the repository on 2024-7-31.

Please help to keep this site up to date! If you want to point out important material or projects that are not listed here, if you find errors or want to suggest improvements, please send email to email