[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] 100?100 hang-up

From: Elias Mårtenson
Subject: Re: [Bug-apl] 100?100 hang-up
Date: Tue, 13 Oct 2015 18:17:20 +0800

I see an off-by-1 error in that code. If set_size is equal to 15, then set_size/8 will be 1, which can only fit 8 bytes.

It should be new set_size/8+1 on both the like with new and the subsequent memset() one.

Making this change fixes the problem.


On 13 October 2015 at 18:11, Jay Foad <address@hidden> wrote:
But 104?104 is fine! It's broken when the argument is not a multiple
of 8. This code (in Bif_F12_ROLL::eval_AB in ScalarFunction.cc) should
round up to a multiple of 8, not down.

   // set_size can be rather big, so we new/delete it
uint8_t * used = new uint8_t[set_size/8];
   memset(used, 0, set_size/8);


On 13 October 2015 at 00:48, Louis de Forcrand <address@hidden> wrote:
> Hello again,
> If I enter 100?100 GNU-APL inexplicably hangs up.
> I tried moving up from 90?90 and found that it
> "breaks" at around 90?90, although this is not
> consistent.
> ^C does nothing.
> Again, I'm on 64-bit Mac OS X 10.10.5, 2009 MacBook Pro.
> ⊣Louis

reply via email to

[Prev in Thread] Current Thread [Next in Thread]