wbenny / hvpp

hvpp is a lightweight Intel x64/VT-x hypervisor written in C++ focused primarily on virtualization of already running operating system
MIT License
1.12k stars 221 forks source link

Syntax error occurs in vmexit_passthrough.cpp file #48

Closed hwooo closed 3 years ago

hwooo commented 3 years ago
Severity    Code    Description Project File    Line    Suppression State
Error   C2143   syntax error: missing ')' before '}'    hvpp
Error   C2143   syntax error: missing ';' before '}'    hvpp

The error occrus in here:

static const uint8_t* skip_prefixes(const uint8_t* first, const uint8_t* last) noexcept
{
  //
  // Return the first byte of the opcode that is not a prefix.
  //
  return std::find_if(first, last, [&](uint8_t byte){         
      //
      // List of prefix types that should be skipped, LOCK is not included as it'd #UD.
      //
      static constexpr uint8_t skip_table[] = {
              0xF2, 0xF3, 0x2E, 0x36, 0x3E, 0x26, 0x64, 0x65, 0x2E, 0x3E, 0x66, 0x67
      };
      return std::find(std::begin(skip_table), std::end(skip_table), byte) == std::end(skip_table);
  }
}

But Visual Studio doesn't notify any syntax error. I have no idea what's the problem.

hwooo commented 3 years ago

I've found solution.

static const uint8_t* skip_prefixes(const uint8_t* first, const uint8_t* last) noexcept
{
          ...
      return std::find(std::begin(skip_table), std::end(skip_table), byte) == std::end(skip_table);
  });  // Add closing parentheses and semicolon
}