01.03.2017, 10:22
(
Последний раз редактировалось Yashas; 01.03.2017 в 10:57.
)
https://github.com/Zeex/pawn/issues/137
I think that bug can be abused to avoid functions calls completely.
This would make it pretty fast because it eliminates the function call needed for every access.
The extra space (pointer[1][0 and 1]) can be used to store some useful information if needed.
I think that bug can be abused to avoid functions calls completely.
Код:
new pointer[][] = {{1},{1,2}}; //1 and 1,2 are placeholders //the compiler will allocate space for the array as if it was pointer[2][] //but it does not store the maximum size for the second dimension in the compiler's compile-time symbol table //therefore, the compiler does not know the size of the second dimension //this will allow you to use any index for the 2nd dimension //pointer[0][1000] the compiler won't complain about the index being 1000 getaddress(pointer, array); //fix the indirection table pointer[0][5000]; //no warning, no error
The extra space (pointer[1][0 and 1]) can be used to store some useful information if needed.