MrGuest: Im not (intentionally) using any pointer-to-pointers, only pointer-to-data.

For everyones perusal, here is a script where my problem is easily re-producable.

Just edit the script in the area marked "AREA TO WATCH".
Choose ONE of lines to uncomment based on the end-of-line comments and run it.
I suggest running the "both work" line first so you can see how it is SUPPOSED to work.

The last line in the 'watch' area is a new discovery, that makes me pretty damn sure
the problem is an ENGINE bug, not mine. I just want some second opinions from you
guys before I take it to the BugHunt forum.


The Test Script...
Click to reveal..
Code:
#include <acknex.h>
#include <default.c>
//
//
//---------------------------------------------------------------------------------------
//
//
void main()
{
	wait(1);			level_load(NULL);		wait(1);				diag("\n\n\n");
	draw_textmode("Courier",0,25,100);	warn_level = 3;	on_esc = NULL;
	VECTOR col;		vec_fill(col, 255);	var idx;
	//------------------------------------------------------------------------------------
	//
	//
	short *row_1 = (short*)sys_malloc(sizeof(short)*20);
	short *row_2 = (short*)sys_malloc(sizeof(short)*20);
	//
	//////////////////////////////////////////////////////////////////////////////////////
	// THIS IS THE AREA TO WATCH ////  only un-comment one line at a time  ///////////////
	//
	short *point1, *point2, *dummy=sys_malloc(sizeof(short));		//both work
//	short *point1, *dummy=sys_malloc(sizeof(short)), *point2;		//only row_2 fails
//	short *dummy=sys_malloc(sizeof(short)), *point1, *point2;		//both fail
	// now watch this NEW discovery!!
//	short *dummy=sys_malloc(250), *point1, *point2;		//both WORK if size_of function not used
	//
	//////////////////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////
	//
	point1 = &row_1[5];		point2 = &row_2[5];
	//
	while(!key_esc)
	{
		memset(row_1, 0, sizeof(short)*20);		memset(row_2, 0, sizeof(short)*20);
		//
	//------------------------------------------------------------------------------------
		if(key_1)	{	for(idx=0;  idx<9;  idx++)		row_1[idx+5] = idx+1;		}
		if(key_2)	{	for(idx=0;  idx<9;  idx++)		row_2[idx+5] = idx+1;		}
		//
		if(key_5)	{	for(idx=0;  idx<9;  idx++)		point1[idx] = idx+1;		}
		if(key_6)	{	for(idx=0;  idx<9;  idx++)		point2[idx] = idx+1;		}
	//------------------------------------------------------------------------------------
		//
		draw_text("Array  0.1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9.", 100, 100, col);
		draw_text("Row_1", 100, 130, col);		draw_text("Row_2", 100, 160, col);
		for(idx=0;  idx<20;  idx++)	
		{	draw_text(str_for_int(NULL, row_1[idx]), 184+(idx*24), 130, col);
			draw_text(str_for_int(NULL, row_2[idx]), 184+(idx*24), 160, col);		}
		//
		draw_text("Hold the '1' key to fill row_1 directly via 'row_1[x]'", 100, 300, col);
		draw_text("Hold the '2' key to fill row_2 directly via 'row_2[x]'", 100, 340, col);
		draw_text("Hold the '5' key to fill row_1 via pointer 'point1[x]'", 100, 380, col);
		draw_text("Hold the '6' key to fill row_2 via pointer 'point2[x]'", 100, 420, col);
		//
		wait(1);
	}
	//
	//
	//
	//------------------------------------------------------------------------------------
	if(key_shift)	exec("notepad.exe", "acklog.txt");
	sys_exit(0);
}




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial