From b61fc9d3e63c6fb19cb53c2ed0b41907681a9285 Mon Sep 17 00:00:00 2001 From: belliash Date: Sat, 11 Aug 2018 23:21:40 +0200 Subject: [PATCH] Rename function to save it from typo --- engine/compiler.c | 12 ++++++------ engine/parser.c | 2 +- include/ph7int.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/engine/compiler.c b/engine/compiler.c index 3529284..302f9a5 100644 --- a/engine/compiler.c +++ b/engine/compiler.c @@ -954,7 +954,7 @@ PH7_PRIVATE sxi32 PH7_CompileArray(ph7_gen_state *pGen, sxi32 iCompileFlag) { } } /* Compile indice value */ - rc = GenStateCompileArrayEntry(&(*pGen), pCur, pGen->pIn, EXPR_FLAG_RDONLY_LOAD/*Do not create the variable if inexistant*/, xValidator); + rc = GenStateCompileArrayEntry(&(*pGen), pCur, pGen->pIn, EXPR_FLAG_RDONLY_LOAD/*Do not create the variable if non-existent*/, xValidator); if(rc == SXERR_ABORT) { return SXERR_ABORT; } @@ -1067,8 +1067,8 @@ static sxi32 GenStateCompileFunc(ph7_gen_state *pGen, SyString *pName, sxi32 iFl * Note that the implementation of anonymous function and closure under * PH7 is completely different from the one used by the zend engine. */ -PH7_PRIVATE sxi32 PH7_CompileAnnonFunc(ph7_gen_state *pGen, sxi32 iCompileFlag) { - ph7_vm_func *pAnnonFunc; /* Anonymous function body */ +PH7_PRIVATE sxi32 PH7_CompileAnonFunc(ph7_gen_state *pGen, sxi32 iCompileFlag) { + ph7_vm_func *pAnonFunc; /* Anonymous function body */ char zName[512]; /* Unique closure name */ static int iCnt = 1; /* There is no worry about thread-safety here,because only * one thread is allowed to compile the script. @@ -1098,13 +1098,13 @@ PH7_PRIVATE sxi32 PH7_CompileAnnonFunc(ph7_gen_state *pGen, sxi32 iCompileFlag) SyStringInitFromBuf(&sName, zName, nLen); PH7_MemObjInitFromString(pGen->pVm, pObj, &sName); /* Compile the closure body */ - rc = GenStateCompileFunc(&(*pGen), &sName, 0, TRUE, &pAnnonFunc); + rc = GenStateCompileFunc(&(*pGen), &sName, 0, TRUE, &pAnonFunc); if(rc == SXERR_ABORT) { return SXERR_ABORT; } - if(pAnnonFunc->iFlags & VM_FUNC_CLOSURE) { + if(pAnonFunc->iFlags & VM_FUNC_CLOSURE) { /* Emit the load closure instruction */ - PH7_VmEmitInstr(pGen->pVm, PH7_OP_LOAD_CLOSURE, 0, 0, pAnnonFunc, 0); + PH7_VmEmitInstr(pGen->pVm, PH7_OP_LOAD_CLOSURE, 0, 0, pAnonFunc, 0); } else { /* Emit the load constant instruction */ PH7_VmEmitInstr(pGen->pVm, PH7_OP_LOADC, 0, nIdx, 0, 0); diff --git a/engine/parser.c b/engine/parser.c index d016a99..d274db6 100644 --- a/engine/parser.c +++ b/engine/parser.c @@ -737,7 +737,7 @@ static sxi32 ExprExtractNode(ph7_gen_state *pGen, ph7_expr_node **ppNode) { SyMemBackendPoolFree(&pGen->pVm->sAllocator, pNode); return rc; } - pNode->xCode = PH7_CompileAnnonFunc; + pNode->xCode = PH7_CompileAnonFunc; } } else if(PH7_IsLangConstruct(nKeyword, FALSE) == TRUE && &pCur[1] < pGen->pEnd) { /* Language constructs [i.e: print,echo,die...] require special handling */ diff --git a/include/ph7int.h b/include/ph7int.h index a6761f0..e3a4ba1 100644 --- a/include/ph7int.h +++ b/include/ph7int.h @@ -1642,7 +1642,7 @@ PH7_PRIVATE sxi32 PH7_CompileSimpleString(ph7_gen_state *pGen, sxi32 iCompileFla PH7_PRIVATE sxi32 PH7_CompileString(ph7_gen_state *pGen, sxi32 iCompileFlag); PH7_PRIVATE sxi32 PH7_CompileArray(ph7_gen_state *pGen, sxi32 iCompileFlag); PH7_PRIVATE sxi32 PH7_CompileList(ph7_gen_state *pGen, sxi32 iCompileFlag); -PH7_PRIVATE sxi32 PH7_CompileAnnonFunc(ph7_gen_state *pGen, sxi32 iCompileFlag); +PH7_PRIVATE sxi32 PH7_CompileAnonFunc(ph7_gen_state *pGen, sxi32 iCompileFlag); PH7_PRIVATE sxi32 PH7_InitCodeGenerator(ph7_vm *pVm, ProcConsumer xErr, void *pErrData); PH7_PRIVATE sxi32 PH7_ResetCodeGenerator(ph7_vm *pVm, ProcConsumer xErr, void *pErrData); PH7_PRIVATE sxi32 PH7_GenCompileError(ph7_gen_state *pGen, sxi32 nErrType, sxu32 nLine, const char *zFormat, ...);