Skip to content

Conversation

@leonerd
Copy link
Contributor

@leonerd leonerd commented Feb 8, 2024

The original code was wrong on two counts:

  • Using Newx() instead of PerlMemShared_malloc()
  • Creating a generic UNOP_AUX_item array instead of the special struct type

class.c Outdated
UNOP_AUX_item *aux;
Newx(aux, 3, UNOP_AUX_item);
struct op_argcheck_aux *aux = (struct op_argcheck_aux *)
PerlMemShared_malloc(sizeof(struct op_argcheck_aux));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer sizeof *aux.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Force-pushed.

@leonerd leonerd force-pushed the bugfix-class_c-alloc-argcheck-aux branch from 738fb39 to 4da33e4 Compare February 8, 2024 22:01
The original code was wrong on two counts:
 * Using Newx() instead of PerlMemShared_malloc()
 * Creating a generic UNOP_AUX_item array instead of the special struct
   type
@khwilliamson
Copy link
Contributor

The first smokes are showing this fixes it

@leonerd leonerd merged commit 48c6b5d into Perl:blead Feb 9, 2024
@leonerd leonerd deleted the bugfix-class_c-alloc-argcheck-aux branch February 9, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants