-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix sal warnings #2279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix sal warnings #2279
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -295,8 +295,9 @@ Encoder::Encode() | |
| { | ||
| if (m_func->IsOOPJIT()) | ||
| { | ||
| Js::ThrowMapEntry * throwMap = NativeCodeDataNewArrayNoFixup(m_func->GetNativeCodeDataAllocator(), Js::ThrowMapEntry, m_pragmaInstrToRecordMap->Count()); | ||
| for (int32 i = 0; i < m_pragmaInstrToRecordMap->Count(); i++) | ||
| int allocSize = m_pragmaInstrToRecordMap->Count(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| Js::ThrowMapEntry * throwMap = NativeCodeDataNewArrayNoFixup(m_func->GetNativeCodeDataAllocator(), Js::ThrowMapEntry, allocSize); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What's the problem in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The calls to m_pragmaInstrToRecordMap->Count() for AllocatorArray and loop counter is not recognized as equivalent by the analyzer. |
||
| for (int i = 0; i < allocSize; i++) | ||
| { | ||
| IR::PragmaInstr *inst = m_pragmaInstrToRecordMap->Item(i); | ||
| throwMap[i].nativeBufferOffset = inst->m_offsetInBuffer; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only need this if
RECYCLER_MEMORY_VERIFYis not defined? I don't see it is set whenRECYCLER_MEMORY_VERIFYis defined.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RECYCLER_MEMORY_VERIFY means it's checked build, which looks we don't run pre-fast with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no warning when
RECYCLER_MEMORY_VERIFYis defined,pLocalNumberis allocated as :pLocalNumber = (Js::JavascriptNumber*)alloca(sizeCat);So at
WriteProcessMemory(hProcess, (void*)number, pLocalNumber, sizeCat, NULL)there will be no warning from the analyzer, sayingpLocalNumbershould be >=sizeCat.Also looks like when
RECYCLER_MEMORY_VERIFYis definedsizeCatcan be larger thansizeof(Js::JavascriptNumber).