Skip to content

Commit c2bdc6e

Browse files
Lev ZeninLev Zenin
authored andcommitted
intpr
1 parent 8c1d555 commit c2bdc6e

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

Source/PHPAPI.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ function GetSAPIGlobals : Psapi_globals_struct;
345345
begin
346346
Result := nil;
347347
if Assigned(sapi_globals_id) then
348-
Result := __asm_fetchval(integer(sapi_globals_id^), tsrmls_fetch);
348+
Result := __asm_fetchval(IntPtr(sapi_globals_id^), tsrmls_fetch);
349349
end;
350350
function GetSAPIGlobals(TSRMLS_DC : pointer) : Psapi_globals_struct;
351351
var
@@ -354,7 +354,7 @@ function GetSAPIGlobals(TSRMLS_DC : pointer) : Psapi_globals_struct;
354354
Result := nil;
355355
sapi_global_id := GetProcAddress(PHPLib, 'sapi_globals_id');
356356
if Assigned(sapi_global_id) then
357-
Result := __asm_fetchval(integer(sapi_globals_id^), TSRMLS_DC);
357+
Result := __asm_fetchval(IntPtr(sapi_globals_id^), TSRMLS_DC);
358358
end;
359359

360360
function GetStringOf(const V: TVarData): string;
@@ -407,7 +407,7 @@ function GetPHPGlobals(TSRMLS_DC : pointer) : Pphp_Core_Globals;
407407
begin
408408
Result := nil;
409409
if Assigned(core_globals_id) then
410-
Result := Pphp_Core_Globals(__asm_fetchval(integer(core_globals_id^), TSRMLS_DC));
410+
Result := Pphp_Core_Globals(__asm_fetchval(IntPtr(core_globals_id^), TSRMLS_DC));
411411
end;
412412

413413

Source/ZENDAPI.pas

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3301,12 +3301,7 @@ function zend_register_functions(functions : {$IFDEF PHP7}P_zend_function_entry{
33013301

33023302
end;
33033303

3304-
function __asm_fetchval
3305-
{$IFDEF CPUX64}
3306-
(val_id: int64; tsrmls_dc_p: pointer)
3307-
{$ELSE}
3308-
(val_id: integer; tsrmls_dc_p: pointer)
3309-
{$ENDIF}
3304+
function __asm_fetchval(val_id: IntPtr; tsrmls_dc_p: pointer)
33103305
: pointer; assembler; register;
33113306
{$IFDEF CPUX64}
33123307
asm
@@ -3335,7 +3330,7 @@ function GetGlobalResource(resource_name: AnsiString) : pointer;
33353330
global_id := GetProcAddress(PHPLib, zend_pchar(resource_name));
33363331
if Assigned(global_id) then
33373332
begin
3338-
Result := __asm_fetchval(integer(global_id^), tsrmls_fetch);
3333+
Result := __asm_fetchval(IntPtr(global_id^), tsrmls_fetch);
33393334
end;
33403335
except
33413336
Result := nil;
@@ -3351,7 +3346,7 @@ function GetGlobalResourceDC(resource_name: AnsiString;TSRMLS_DC:pointer) : poin
33513346
global_id := GetProcAddress(PHPLib, zend_pchar(resource_name));
33523347
if Assigned(global_id) then
33533348
begin
3354-
Result := __asm_fetchval(integer(global_id^), TSRMLS_DC);
3349+
Result := __asm_fetchval(IntPtr(global_id^), TSRMLS_DC);
33553350
end;
33563351
except
33573352
Result := nil;

0 commit comments

Comments
 (0)