Ignore:
Timestamp:
Apr 11, 2022, 1:02:54 PM (3 years ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
13888c0e, 437b8b5
Parents:
a08443b
Message:

Adding runtime bound checking for array subscripts and showing the optimizer removing them.

Adding draft thesis content on dependent types and bound checks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/containers/array.hfa

    ra08443b r8d76f2b  
     1#include <assert.h>
    12
    23
     
    3435
    3536    static inline Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, int i ) {
     37        assert( i < N );
    3638        return (Timmed &) a.strides[i];
    3739    }
    3840
    3941    static inline Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, unsigned int i ) {
     42        assert( i < N );
    4043        return (Timmed &) a.strides[i];
    4144    }
    4245
    4346    static inline Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, long int i ) {
     47        assert( i < N );
    4448        return (Timmed &) a.strides[i];
    4549    }
    4650
    4751    static inline Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, unsigned long int i ) {
     52        assert( i < N );
    4853        return (Timmed &) a.strides[i];
    4954    }
Note: See TracChangeset for help on using the changeset viewer.