View Issue Details

IDProjectCategoryView StatusLast Update
0002781Far Manager_Commonpublic2015-01-05 12:31
ReporterMaximusAssigned ToDrKnS 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx86OSWindowsOS Version8
Product Version3.0 
Target VersionFixed in Version3.0 
Summary0002781: Exception при работе под отладчиком VS2013
DescriptionRun-Time Check Failure #1 - A cast to a smaller data type has caused a loss of data. If this was intentional, you should mask the source of the cast with the appropriate bitmask.

Приведение к (WORD) вызывает ругань отладчика (exceptions) если сие обрезает не маскированные заранее биты.
TagsNo tags attached.
Build4130

Activities

Maximus

2014-08-29 17:12

reporter  

mantis-Run-Time-Check-Failure.patch (1,351 bytes)
From e3bb481fb55dd76bdae40343159f85c777af9617 Mon Sep 17 00:00:00 2001
From: Maximus5 <ConEmu.Maximus5@gmail.com>
Date: Fri, 29 Aug 2014 00:52:10 +0400
Subject: [PATCH] Far3bis. Run-Time Check Failure #1 - A cast to a smaller data
 type has caused a loss of data

---
 unicode_far/colormix.cpp | 2 +-
 unicode_far/headers.hpp  | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/unicode_far/colormix.cpp b/unicode_far/colormix.cpp
index 101009b..b5a4318 100644
--- a/unicode_far/colormix.cpp
+++ b/unicode_far/colormix.cpp
@@ -143,7 +143,7 @@ WORD Colors::FarColorToConsoleColor(const FarColor& Color)
 		Result = (IndexColors[0] << ConsoleBgShift) | (IndexColors[1] << ConsoleFgShift);
 	}
 
-	return (WORD)(Result | ((WORD)(Color.Flags) & ConsoleExtraMask));
+	return (WORD)(Result | ((WORD)(Color.Flags & ConsoleExtraMask)));
 }
 
 FarColor Colors::ConsoleColorToFarColor(WORD Color)
diff --git a/unicode_far/headers.hpp b/unicode_far/headers.hpp
index 5f9eb11..a08b594 100644
--- a/unicode_far/headers.hpp
+++ b/unicode_far/headers.hpp
@@ -178,6 +178,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 # include "SDK/sdk.gcc.h"
 #endif // __GNUC__
 
+#undef GetGValue
+#define GetGValue(rgb)      (LOBYTE((rgb) >> 8))
+
 #include "cpp.hpp"
 
 #include "common.hpp"
-- 
1.8.5.2.msysgit.0

Maximus

2014-10-08 10:44

reporter   bugnote:0013067

А почему собственно патч не полностью применили?

Maximus

2014-10-08 10:45

reporter  

2014-10-08_10-45-13.png (26,259 bytes)
2014-10-08_10-45-13.png (26,259 bytes)

DrKnS

2014-10-08 18:55

administrator   bugnote:0013069

?

Maximus

2014-10-08 19:05

reporter   bugnote:0013070

headers.hpp

+#undef GetGValue
+#define GetGValue(rgb) (LOBYTE((rgb) >> 8))
+

DrKnS

2014-10-08 19:13

administrator   bugnote:0013071

А какое отношение это имеет к "Exception при работе под отладчиком VS2013"?

Maximus

2014-10-08 19:15

reporter   bugnote:0013072

Прямое. Ексепшн на скриншоте видно?
Дефайн в винапи как-то не рассчитан на 32бита.

DrKnS

2014-10-08 20:58

administrator   bugnote:0013073

Ok, 4129.

2useven10

2014-10-09 02:19

developer   bugnote:0013075

Last edited: 2014-10-09 02:19

View 2 revisions

для little-endian порядок байт в abgr должен быть обратным ?

DrKnS

2014-10-09 02:55

administrator   bugnote:0013077

4130.

Issue History

Date Modified Username Field Change
2014-08-29 17:12 Maximus New Issue
2014-08-29 17:12 Maximus File Added: mantis-Run-Time-Check-Failure.patch
2014-08-30 15:05 DrKnS Build => 4071
2014-08-30 15:05 DrKnS Status new => closed
2014-08-30 15:05 DrKnS Assigned To => DrKnS
2014-08-30 15:05 DrKnS Resolution open => fixed
2014-08-30 15:05 DrKnS Fixed in Version => 3.0
2014-10-08 10:44 Maximus Note Added: 0013067
2014-10-08 10:44 Maximus Status closed => feedback
2014-10-08 10:44 Maximus Resolution fixed => reopened
2014-10-08 10:45 Maximus File Added: 2014-10-08_10-45-13.png
2014-10-08 18:55 DrKnS Note Added: 0013069
2014-10-08 19:05 Maximus Note Added: 0013070
2014-10-08 19:05 Maximus Status feedback => assigned
2014-10-08 19:13 DrKnS Note Added: 0013071
2014-10-08 19:15 Maximus Note Added: 0013072
2014-10-08 20:58 DrKnS Note Added: 0013073
2014-10-08 20:58 DrKnS Status assigned => feedback
2014-10-09 02:19 2useven10 Note Added: 0013075
2014-10-09 02:19 2useven10 Note Edited: 0013075 View Revisions
2014-10-09 02:55 DrKnS Note Added: 0013077
2015-01-05 12:31 DrKnS Build 4071 => 4130
2015-01-05 12:31 DrKnS Status feedback => closed
2015-01-05 12:31 DrKnS Resolution reopened => fixed