Index: driver/as.cc
===================================================================
--- driver/as.cc	(revision ba80f99856a2090ae6273eb24fae13a9e695ebdd)
+++ driver/as.cc	(revision 245a92ccbd9dced120327cb53d35b1a5ad374555)
@@ -5,11 +5,12 @@
 // file "LICENCE" distributed with Cforall.
 // 
-// as.c -- 
+// as.c -- map assembler file, scan for debug information. If found, expand file by one character and insert Cforall
+//         language code on the N line from the start of the debug information.
 // 
 // Author           : Peter A. Buhr
 // Created On       : Wed Aug  1 10:49:42 2018
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Aug 22 17:30:24 2018
-// Update Count     : 93
+// Last Modified On : Sat Sep  8 08:40:16 2018
+// Update Count     : 97
 // 
 
@@ -43,25 +44,27 @@
 	off_t size = mystat.st_size;
 
-	char * start = (char *)mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
-	if ( start == (void *)-1 ) { perror( "mmap" ); exit( EXIT_FAILURE ); };
+	if ( size ) {										// cannot map 0 sized file
+		char * start = (char *)mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 );
+		if ( start == (void *)-1 ) { perror( "mmap" ); exit( EXIT_FAILURE ); };
 
-	if ( char * cursor = strstr( start, ".Ldebug_info0:" ) ) { // debug information ?
-		// Expand file by one byte to hold 2 character Cforall language code.
-		if ( ftruncate( fd, size + 1 ) ) { perror( "ftruncate" ); exit( EXIT_FAILURE ); };
+		if ( char * cursor = strstr( start, ".Ldebug_info0:" ) ) { // debug information ?
+			// Expand file by one byte to hold 2 character Cforall language code.
+			if ( ftruncate( fd, size + 1 ) ) { perror( "ftruncate" ); exit( EXIT_FAILURE ); };
 
-		for ( int i = 0; i < 8; i += 1 ) {				// move N (magic) lines forward
-			cursor = strstr( cursor, "\n" ) + 1;
-		} // for
+			for ( int i = 0; i < 8; i += 1 ) {			// move N (magic) lines forward
+				cursor = strstr( cursor, "\n" ) + 1;
+			} // for
 
-		cursor -= 2;									// backup over "c\n" language value
-		if ( *(cursor - 1) != 'x' ) { fprintf( stderr, "invalid C language code\n" ); exit( EXIT_FAILURE ); };
+			cursor -= 2;								// backup over "c\n" language value
+			if ( *(cursor - 1) != 'x' ) { fprintf( stderr, "invalid C language code\n" ); exit( EXIT_FAILURE ); };
 
-		memmove( cursor + 2, cursor + 1, start + size - cursor - 1 ); // move remaining text 1 character right
+			memmove( cursor + 2, cursor + 1, start + size - cursor - 1 ); // move remaining text 1 character right
 
-		*(cursor) = '2';								// replace C language value with CFA
-		*(cursor + 1) = '5';
+			*(cursor) = '2';							// replace C language value with CFA
+			*(cursor + 1) = '5';
+		} // if
+
+		if ( munmap( start, size ) ) { perror( "munmap" ); exit( EXIT_FAILURE ); }; // update on disk
 	} // if
-
-	if ( munmap( start, size ) ) { perror( "munmap" ); exit( EXIT_FAILURE ); }; // update on disk
 
 	argv[0] = "as";
