Subject: | product() implementation fails to extend the stack |
In -DDEBUGGING builds of development perls there are now checks that ops properly extend the stack before using the space on the stack.
The product() function in WalshTransform.xs uses up to nx entries, but doesn't extend the stack at all. Without this extension the product() function could potentially be writing past the end of an allocated block of memory.
Adding:
EXTEND(SP, nx);
before the for loop properly extends the stack and prevents the error.
Tony