Permalink
Browse files

Output error on negative area size

  • Loading branch information...
Kingcom committed Apr 2, 2018
1 parent c19500c commit b8b613d09c99e3678db4a3aa7ee85e42767f8298
Showing with 10 additions and 4 deletions.
  1. +8 −2 Commands/CDirectiveArea.cpp
  2. +2 −2 Commands/CDirectiveArea.h
@@ -26,8 +26,8 @@ void CDirectiveArea::setFillExpression(Expression& exp)

bool CDirectiveArea::Validate()
{
size_t oldAreaSize = areaSize;
size_t oldContentSize = contentSize;
int64_t oldAreaSize = areaSize;
int64_t oldContentSize = contentSize;

position = g_fileManager->getVirtualAddress();

@@ -37,6 +37,12 @@ bool CDirectiveArea::Validate()
return false;
}

if (areaSize < 0)
{
Logger::queueError(Logger::Error, L"Negative area size");
return false;
}

if (fillExpression.isLoaded())
{
if (fillExpression.evaluateInteger(fillValue) == false)
@@ -16,8 +16,8 @@ class CDirectiveArea: public CAssemblerCommand
private:
int64_t position;
Expression sizeExpression;
size_t areaSize;
size_t contentSize;
int64_t areaSize;
int64_t contentSize;
Expression fillExpression;
int8_t fillValue;
CAssemblerCommand* content;

0 comments on commit b8b613d

Please sign in to comment.