aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/lscript/lscript_compile/lscript_bytecode.cpp')
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_bytecode.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp b/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp
index 6d18a1a..b696cc6 100644
--- a/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp
@@ -78,7 +78,7 @@ void LLScriptByteCodeChunk::addByte(U8 byte)
78 if (mCodeChunk) 78 if (mCodeChunk)
79 { 79 {
80 U8 *temp = new U8[mCurrentOffset + 1]; 80 U8 *temp = new U8[mCurrentOffset + 1];
81 memcpy(temp, mCodeChunk, mCurrentOffset); 81 memcpy(temp, mCodeChunk, mCurrentOffset); /* Flawfinder: ignore */
82 delete [] mCodeChunk; 82 delete [] mCodeChunk;
83 mCodeChunk = temp; 83 mCodeChunk = temp;
84 } 84 }
@@ -102,7 +102,7 @@ void LLScriptByteCodeChunk::addBytes(U8 *bytes, S32 size)
102 if (mCodeChunk) 102 if (mCodeChunk)
103 { 103 {
104 U8 *temp = new U8[mCurrentOffset + size]; 104 U8 *temp = new U8[mCurrentOffset + size];
105 memcpy(temp, mCodeChunk, mCurrentOffset); 105 memcpy(temp, mCodeChunk, mCurrentOffset); /* Flawfinder: ignore */
106 delete [] mCodeChunk; 106 delete [] mCodeChunk;
107 mCodeChunk = temp; 107 mCodeChunk = temp;
108 } 108 }
@@ -110,7 +110,7 @@ void LLScriptByteCodeChunk::addBytes(U8 *bytes, S32 size)
110 { 110 {
111 mCodeChunk = new U8[size]; 111 mCodeChunk = new U8[size];
112 } 112 }
113 memcpy(mCodeChunk + mCurrentOffset, bytes, size); 113 memcpy(mCodeChunk + mCurrentOffset, bytes, size);/* Flawfinder: ignore */
114 mCurrentOffset += size; 114 mCurrentOffset += size;
115} 115}
116 116
@@ -119,7 +119,7 @@ void LLScriptByteCodeChunk::addBytes(char *bytes, S32 size)
119 if (mCodeChunk) 119 if (mCodeChunk)
120 { 120 {
121 U8 *temp = new U8[mCurrentOffset + size]; 121 U8 *temp = new U8[mCurrentOffset + size];
122 memcpy(temp, mCodeChunk, mCurrentOffset); 122 memcpy(temp, mCodeChunk, mCurrentOffset); /*Flawfinder: ignore*/
123 delete [] mCodeChunk; 123 delete [] mCodeChunk;
124 mCodeChunk = temp; 124 mCodeChunk = temp;
125 } 125 }
@@ -127,7 +127,7 @@ void LLScriptByteCodeChunk::addBytes(char *bytes, S32 size)
127 { 127 {
128 mCodeChunk = new U8[size]; 128 mCodeChunk = new U8[size];
129 } 129 }
130 memcpy(mCodeChunk + mCurrentOffset, bytes, size); 130 memcpy(mCodeChunk + mCurrentOffset, bytes, size); /*Flawfinder: ignore*/
131 mCurrentOffset += size; 131 mCurrentOffset += size;
132} 132}
133 133
@@ -136,7 +136,7 @@ void LLScriptByteCodeChunk::addBytes(S32 size)
136 if (mCodeChunk) 136 if (mCodeChunk)
137 { 137 {
138 U8 *temp = new U8[mCurrentOffset + size]; 138 U8 *temp = new U8[mCurrentOffset + size];
139 memcpy(temp, mCodeChunk, mCurrentOffset); 139 memcpy(temp, mCodeChunk, mCurrentOffset); /*Flawfinder: ignore*/
140 delete [] mCodeChunk; 140 delete [] mCodeChunk;
141 mCodeChunk = temp; 141 mCodeChunk = temp;
142 } 142 }
@@ -153,7 +153,7 @@ void LLScriptByteCodeChunk::addBytesDontInc(S32 size)
153 if (mCodeChunk) 153 if (mCodeChunk)
154 { 154 {
155 U8 *temp = new U8[mCurrentOffset + size]; 155 U8 *temp = new U8[mCurrentOffset + size];
156 memcpy(temp, mCodeChunk, mCurrentOffset); 156 memcpy(temp, mCodeChunk, mCurrentOffset); /*Flawfinder: ignore*/
157 delete [] mCodeChunk; 157 delete [] mCodeChunk;
158 mCodeChunk = temp; 158 mCodeChunk = temp;
159 } 159 }
@@ -256,7 +256,7 @@ void LLScriptScriptCodeChunk::build(FILE *efp, FILE *bcfp)
256 mCompleteCode = new U8[mTotalSize]; 256 mCompleteCode = new U8[mTotalSize];
257 memset(mCompleteCode, 0, mTotalSize); 257 memset(mCompleteCode, 0, mTotalSize);
258 258
259 memcpy(mCompleteCode, mRegisters->mCodeChunk, mRegisters->mCurrentOffset); 259 memcpy(mCompleteCode, mRegisters->mCodeChunk, mRegisters->mCurrentOffset);
260 offset += mRegisters->mCurrentOffset; 260 offset += mRegisters->mCurrentOffset;
261 261
262 set_register(mCompleteCode, LREG_IP, 0); 262 set_register(mCompleteCode, LREG_IP, 0);
@@ -267,12 +267,12 @@ void LLScriptScriptCodeChunk::build(FILE *efp, FILE *bcfp)
267 267
268 set_register(mCompleteCode, LREG_GVR, offset); 268 set_register(mCompleteCode, LREG_GVR, offset);
269 269
270 memcpy(mCompleteCode + offset, mGlobalVariables->mCodeChunk, mGlobalVariables->mCurrentOffset); 270 memcpy(mCompleteCode + offset, mGlobalVariables->mCodeChunk, mGlobalVariables->mCurrentOffset); /*Flawfinder: ignore*/
271 offset += mGlobalVariables->mCurrentOffset; 271 offset += mGlobalVariables->mCurrentOffset;
272 272
273 set_register(mCompleteCode, LREG_GFR, offset); 273 set_register(mCompleteCode, LREG_GFR, offset);
274 274
275 memcpy(mCompleteCode + offset, mGlobalFunctions->mCodeChunk, mGlobalFunctions->mCurrentOffset); 275 memcpy(mCompleteCode + offset, mGlobalFunctions->mCodeChunk, mGlobalFunctions->mCurrentOffset); /*Flawfinder: ignore*/
276 offset += mGlobalFunctions->mCurrentOffset; 276 offset += mGlobalFunctions->mCurrentOffset;
277 277
278 set_register(mCompleteCode, LREG_SR, offset); 278 set_register(mCompleteCode, LREG_SR, offset);
@@ -291,12 +291,12 @@ void LLScriptScriptCodeChunk::build(FILE *efp, FILE *bcfp)
291 } 291 }
292 set_event_register(mCompleteCode, LREG_ER, bytestream2u64(mStates->mCodeChunk, default_state_offset), LSL2_CURRENT_MAJOR_VERSION); 292 set_event_register(mCompleteCode, LREG_ER, bytestream2u64(mStates->mCodeChunk, default_state_offset), LSL2_CURRENT_MAJOR_VERSION);
293 293
294 memcpy(mCompleteCode + offset, mStates->mCodeChunk, mStates->mCurrentOffset); 294 memcpy(mCompleteCode + offset, mStates->mCodeChunk, mStates->mCurrentOffset); /*Flawfinder: ignore*/
295 offset += mStates->mCurrentOffset; 295 offset += mStates->mCurrentOffset;
296 296
297 set_register(mCompleteCode, LREG_HR, offset); 297 set_register(mCompleteCode, LREG_HR, offset);
298 298
299 memcpy(mCompleteCode + offset, mHeap->mCodeChunk, mHeap->mCurrentOffset); 299 memcpy(mCompleteCode + offset, mHeap->mCodeChunk, mHeap->mCurrentOffset); /*Flawfinder: ignore*/
300 offset += mHeap->mCurrentOffset; 300 offset += mHeap->mCurrentOffset;
301 301
302 set_register(mCompleteCode, LREG_HP, offset); 302 set_register(mCompleteCode, LREG_HP, offset);