Skip to content

Commit

Permalink
Fix Bug #400 (crash on slice of slice of bigpdl); add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig DeForest authored and Craig DeForest committed Sep 29, 2015
1 parent dfa1a29 commit f856c1d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Basic/Core/pdlapi.c
Expand Up @@ -1497,7 +1497,7 @@ void pdl_make_physvaffine(pdl *it)
it->vafftrans->incs[i] = incsleft[i];
}
{
int offset_left = it->vafftrans->offs;
PDL_Indx offset_left = it->vafftrans->offs;
inc = it->vafftrans->offs;
newinc = 0;
for(j=current->ndims-1; j>=0 && current->dimincs[j] != 0; j--) {
Expand Down
7 changes: 6 additions & 1 deletion t/bigmem.t
Expand Up @@ -12,7 +12,7 @@ BEGIN {
if ($ENV{AUTOMATED_TESTING} or $ENV{CI_TESTING}) {
plan skip_all => 'bigmem tests skipped to avoid OOM fails';
} else {
plan tests => 1;
plan tests => 2;
}
}

Expand All @@ -35,6 +35,11 @@ $PDL::BIGPDL = 1; # should this be the defaults for 64bit index support?
my $bigbyte = ones( byte, 5*1024*1024*1024+17 );
ok( $bigbyte->shape->sclr == $bigbyte->nelem, "shape handles indx dims > 4GiB");

$bigbyte = ones(byte, 2**30, 4);
my $aaa = $bigbyte->slice("3:-10");
my $bbb = $aaa->slice(":,3");
ok( $bbb->sum == $bbb->nelem, "slices of slices of giant PDLs seem to work right");

# ndims
# getndims
# dim
Expand Down

0 comments on commit f856c1d

Please sign in to comment.