Skip to content
Snippets Groups Projects

msvcp110: Add std::_Throw_future_error.

Merged Daniel Lehman requested to merge dlehman25/wine:throw-future into master
5 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
979
980 /* ?_Throw_future_error@std@@YAXABVerror_code@1@@Z */
981 /* ?_Throw_future_error@std@@YAXAEBVerror_code@1@@Z */
982 void __cdecl DECLSPEC_NORETURN _Throw_future_error( const error_code *error_code )
983 {
984 static const char *names[4] = {
985 "broken promise",
986 "future already retrieved",
987 "promise already satisfied",
988 "no state",
989 };
990 future_error e;
991
992 TRACE("(%p)\n", error_code);
993
994 MSVCP_logic_error_ctor(&e.base, EXCEPTION_NAME(names[error_code->code-1]));
  • Daniel Lehman added 50 commits

    added 50 commits

    Compare with previous version

  • Author Contributor

    ah.. that's what you meant. i get non-null for 5 and up from msvcp110:

    ---- msvcp110.dll 0
    code 'future:0', what 00007FF9D8133BB8:
    code 'future:1', what 00007FF9D8133BC8:
    code 'future:2', what 00007FF9D8133BE8:
    code 'future:3', what 00007FF9D8133C08:
    code 'future:4', what 70206E656B6F7262:
    code 'future:5', what 00006573696D6F72:
    ---- msvcp120.dll 1
    code 'future:1', what 00007FF9C8926C68:
    code 'future:2', what 00007FF9C8926C78:
    code 'future:3', what 00007FF9C8926C98:
    code 'future:4', what 00007FF9C8926CB8:
    code 'future:5', what 0000000000000000:
    code 'future:6', what 0000000000000000:
    ---- msvcp140.dll 1
    code 'future:1', what 00007FF9D88390B0:
    code 'future:2', what 00007FF9D88390C0:
    code 'future:3', what 00007FF9D88390E0:
    code 'future:4', what 00007FF9D8839100:
    code 'future:5', what 0000000000000000:
    code 'future:6', what 0000000000000000:
    done

    but do see null for msvcp120 and msvcp140. i'll fix it

  • Daniel Lehman added 1 commit

    added 1 commit

    • d73d8d55 - msvcp110: Add std::_Throw_future_error.

    Compare with previous version

  • Piotr Caban
    Piotr Caban @piotr started a thread on an outdated change in commit d73d8d55
  • 964
    965 DEFINE_THISCALL_WRAPPER(future_error_copy_ctor, 8)
    966 future_error* __thiscall future_error_copy_ctor(future_error *this, const future_error *rhs)
    967 {
    968 logic_error_copy_ctor(&this->base, &rhs->base);
    969 this->code = rhs->code;
    970 this->base.e.vtable = &future_error_vtable;
    971 return this;
    972 }
    973
    974 DEFINE_THISCALL_WRAPPER(MSVCP_future_error_what, 4)
    975 const char* __thiscall MSVCP_future_error_what(future_error *this)
    976 {
    977
    978 TRACE("%p\n", this);
    979 return this->base.e.name;
    • Comment on lines +977 to +979
      Suggested change
      977
      978 TRACE("%p\n", this);
      979 return this->base.e.name;
      977 const char *names[4] = {
      978 "broken promise",
      979 "future already retrieved",
      980 "promise already satisfied",
      981 "no state",
      982 };
      983 #if _MSVCP_VER == 110
      984 int code = this->code.code;
      985 #else
      986 int code = this->code.code - 1;
      987 #endif
      988
      989 TRACE("%p\n", this);
      990
      991 return code >= 0 && code < ARRAY_SIZE(names) ? names[code] : NULL;
    • Daniel Lehman changed this line in version 5 of the diff

      changed this line in version 5 of the diff

    • Please register or sign in to reply
  • Piotr Caban
    Piotr Caban @piotr started a thread on commit d73d8d55
  • 993 "broken promise",
    994 "future already retrieved",
    995 "promise already satisfied",
    996 "no state",
    997 };
    998 future_error e;
    999 #if _MSVCP_VER == 110
    1000 int code = error_code->code;
    1001 #else
    1002 int code = error_code->code-1;
    1003 #endif
    1004 const char *name = code >= 0 && code < ARRAY_SIZE(names) ? names[code] : NULL;
    1005
    1006 TRACE("(%p)\n", error_code);
    1007
    1008 MSVCP_logic_error_ctor(&e.base, EXCEPTION_NAME(name));
  • Daniel Lehman added 51 commits

    added 51 commits

    Compare with previous version

    • Author Contributor

      Merge request !3767 (merged) !3767 (merged) was reviewed by Piotr Caban https://gitlab.winehq.org/piotr

      Piotr Caban https://gitlab.winehq.org/piotr started a new discussion on dlls/msvcp90/exception.c !3767 (comment 44866): 977

      978

      • TRACE("%p\n", this);

      979

      • return this->base.e.name;
      const char *names[4] = {        "broken promise",        "future already retrieved",        "promise already satisfied",        "no state",    };#if _MSVCP_VER == 110    int code = this->code.code;#else    int code = this->code.code - 1;#endif    TRACE("%p\n", this);    return code >= 0 && code < ARRAY_SIZE(names) ? names[code] : NULL;

      Piotr Caban https://gitlab.winehq.org/piotr started a new discussion on dlls/msvcp90/exception.c !3767 (comment 44867): 1006

      • TRACE("(%p)\n", error_code);

      1007

      1008

      • MSVCP_logic_error_ctor(&e.base, EXCEPTION_NAME(name));

      e.base.name should be set to "".

      i get a different result from windows with the attached test when i set it to "" but in a more pure c++ sample, it's the same as windows

      winebug3.cpp

    • It's because you didn't change MSVCP_future_error_what implementation. What I've meant is that "" name should be used unconditionally in _Throw_future_error and error code to string translation should be done in future_error::what.

    • Author Contributor

      ah... i see what you mean. will do

    • Please register or sign in to reply
  • Daniel Lehman added 49 commits

    added 49 commits

    Compare with previous version

  • Piotr Caban approved this merge request

    approved this merge request

  • Alexandre Julliard approved this merge request

    approved this merge request

  • Please register or sign in to reply
    Loading