Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • driver/as.cc

    r245a92c r80219a8  
    1 // 
     1//
    22// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
    33//
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 // 
     6//
    77// as.c -- map assembler file, scan for debug information. If found, expand file by one character and insert Cforall
    88//         language code on the N line from the start of the debug information.
    9 // 
     9//
    1010// Author           : Peter A. Buhr
    1111// Created On       : Wed Aug  1 10:49:42 2018
     
    1313// Last Modified On : Sat Sep  8 08:40:16 2018
    1414// Update Count     : 97
    15 // 
     15//
    1616
    1717#include <cstdio>                                                                               // perror
     
    4545
    4646        if ( size ) {                                                                           // cannot map 0 sized file
    47                 char * start = (char *)mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
     47                char * start = (char *)mmap( NULL, size + 2, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
    4848                if ( start == (void *)-1 ) { perror( "mmap" ); exit( EXIT_FAILURE ); };
    4949
     
    6565                } // if
    6666
    67                 if ( munmap( start, size ) ) { perror( "munmap" ); exit( EXIT_FAILURE ); }; // update on disk
     67                if ( munmap( start, size + 2 ) ) { perror( "munmap" ); exit( EXIT_FAILURE ); }; // update on disk
    6868        } // if
    6969
Note: See TracChangeset for help on using the changeset viewer.