ãããžã§ã¯ãã§PVS-Studioéçã³ãŒãã¢ãã©ã€ã¶ãŒãã©ã®ããã«ãã¹ããããã®ããŒã«ããã©ã®ãããªå©ç¹ãåŸãããããå€æããããšããã¹ããŒãªãŒãå ±æããããšæããŸãã ãã®èšäºã§ã¯ãå°é家åãã®ãŠããŒã¯ã§èå³æ·±ããœãããŠã§ã¢ãšã©ãŒã«ã€ããŠã¯èª¬æããŸããã éç解æã«ãã£ãŠã³ãŒãã«èŠã€ãã£ããã¹ãŠã®ãã°ãšæ¬ ç¹ã¯ãéåžžã«æ£çºçãªãã®ã§ããããšãå€æããŸããã ããã§ã¯ããã®ããŒã«ããããžã§ã¯ããããŒãžã£ãŒã®èŠ³ç¹ããèŠãŠèª¬æããŸãã ããããããã®è§åºŠã¯ãšã³ãžãã¢ã®è©äŸ¡ã»ã©æ£ç¢ºã§æ確ã§ã¯ãããŸãããç¹å®ã®ãããžã§ã¯ãã®äœæ¥çµç¹ã®ç¹åŸŽãå¹æãçºæ®ããŸãã ããããããã§ããèšäºã§æ瀺ãããèãã¯ãä»äºã§éçåæã䜿çšããããšãèããŠãã人ã«ãšã£ãŠèå³æ·±ããã®ã«ãªããšæããŸãã ãŸãã¯ããããžã§ã¯ãã®æ®µéã§ããã¹ã段éã§çºèŠããããšã©ãŒãä¿®æ£ããããã®ãªãœãŒã¹ã®å€§å¹ ãªæ倱ã«çŽé¢ããŠãã人ã®ããã«ã
ã¯ããã«
ç§ã¯ãä»®æ³å»çã·ãã¥ã¬ãŒã·ã§ã³ã®éçºãå°éãšããEidos-Medicineã§åããŠããŸãã ãããã¯ãæè²ããã»ã¹ã«ãããããŸããŸãªå€ç§çä»å ¥ã®ããã©ãŒãã³ã¹ãã·ãã¥ã¬ãŒãã§ããç¹å¥ãªããŒããŠã§ã¢ããã³ãœãããŠã§ã¢ã·ã¹ãã ã§ãã ã·ãã¥ã¬ãŒã¿ã䜿çšããããšã§ãå»åŠçãã€ã³ã¿ãŒã³ã¯ãçããŠããæ£è ã«å§ããããåã«ãå°éåéã§æåã®å®è·µçãªã¹ãã«ã身ã«ä»ããããšãã§ããŸãã ç§ãã¡ã®èšèšããŒã ã¯ãè¡ç®¡å ä»å ¥ã®ã·ãã¥ã¬ãŒã¿ãŒãéçºããŠããŸãã ãã®é åã«ã¯ãèå éèŠæ³ã®å¶åŸ¡äžã§è¡ãããè¡ç®¡ã«å¯Ÿããå€ãã®çš®é¡ã®æè¡ãå«ãŸããŸããè¡ç®¡åœ¢æè¡ãã¹ãã³ãç眮ãåèç€ã®ãããå¡æ è¡ã倧åèç€ã®å éšäººå·¥åšå®çœ®æè¡ã§ãã
ç§ãã¡ã®ããŒã ã¯ãçŸåšã®æ§æã§ãããžã§ã¯ãã«1幎ååãçµãã§ããŸãã ãã¹ãŠããã€ãã®ããã«ç¶ããŸãã ã³ã³ãµã«ãã£ã³ã°å€ç§å»ã¯ãèŠèŠçã³ã³ããŒãã³ãã®èŠä»¶ã«åãçµã¿ãªãããå€ç§çä»å ¥ã®æŠè¡ã«ã€ããŠæ®µéçã«ã¢ããªã¹ããšååããŠããŸãã 3Dã¢ãŒãã£ã¹ãã¯ã3D CTè¡ç®¡é 圱ã解ååŠçã¢ãã©ã¹ãããã³å€ç§å»ã®ã¢ããã€ã¹ã䜿çšããŠãã·ãã¥ã¬ãŒã¿ãŒã®æ°ããèšåºäŸã®ã¢ãã«ãäœæããŸãã ãããã¬ãã«ã®ããã°ã©ããŒã¯ãèå éèŠæ³ã®å¯èŠåãåèå ã®è¡ç®¡å åšå ·ã®åãã®ç©çåŠãã·ãã¥ã¬ãŒã¿äžã®å£«å®åè£çã®è¡åã®è«ççåæã«åãçµãã§ãããä»å ¥ã®æ®µéã®æ£ç¢ºæ§ãä¿®æ£ããŠããŸãã åè·¯èšèšè ããã€ã¯ãã³ã³ãããŒã©ãŒããã°ã©ããŒãããã³èšèšãšã³ãžãã¢ã¯ãã·ãã¥ã¬ãŒã·ã§ã³ã§äœ¿çšãããå»çæ©åšã®ããŸããŸãªã·ãã¥ã¬ãŒã¿ãŒã®äœæ¥ãæäŸããã»ã³ãµãŒããããŒã¿ãåéãããããã®äºååŠçãšããã°ã©ã ãžã®éä¿¡ãè¡ããŸãã ããã«å¿ããŠãäžäœã¬ãã«ã§ã¯ãæ å ±ãã³ã³ãããŒã©ãŒãžã®éä¿¡çšã«æºåãããããã«åºã¥ããŠãæè²ããã»ã¹ã®æ £ç¿ãæå°éã«æããããã«èšèšããããä»®æ³ä»å ¥ã®ã³ãŒã¹ã«å¯Ÿå¿ããæ©åšã®æ瀺ãšè§ŠèŠãã£ãŒãããã¯ã®å¹æãæäŸãããŸãã
ãããŠãäœæ¥ãå®äºããã³ã³ãã€ã«ãããã¯ãã ä»ããããçµã³ä»ãããã補ç²ãããçµã¿ç«ãŠããããšããã®çµæããã¹ã¿ãŒã«ââéä¿¡ãããŸãã ç§ãã¡ãšã®ãã¹ãã¯ã»ãšãã©æäœæ¥ã§ãã æå°éã®èªåãã¹ãã æ°ããããŒãžã§ã³ã®éçºäžããã¹ã¿ãŒã¯èªåã®ã³ã³ãã¥ãŒã¿ãŒã§ããã°ã©ã ã®çŸåšã®ãªããžã§ã³ããã§ãã¯ããããã©ãŒãã³ã¹ãå®å®æ§ãäœæ¥ã®åŠ¥åœæ§ã確èªããŸãã ããã¯ãããŒãžã§ã³ã®å埩ãéåžžã«é·ããããå±éºãªã³ããããæéå ã«ãã£ããããããã«å¿ èŠã§ãã ãã ãããªãªãŒã¹åè£ã®äž»ãªãã¹ãã¯ãã·ãã¥ã¬ãŒã¿ãŒèªäœã§è¡ãããŸãã é©ãããããããããŸããã 誰ããéä¿¡ãããã³ã«ãšã³ã³ãããŒã©ãŒã®èª¿æŽã§èª°ãã誀解ããŸããã ãŸãã¯ãã·ãã¥ã¬ãŒã¿ãŒã§äœæ¥ãããšãã®ããŒã«ã·ãã¥ã¬ãŒã¿ãŒã®åãã®ãã€ããã¯ã¹ã¯ãããŒããŒãããã®ãããã°ã³ã³ãããŒã«ãšã¯ãããã«ç°ãªããããã¯ç©çãšã³ãžã³ã«é倧ãªåé¡ããããããŸãã ãŸãã¯ãæ°ããããŒãžã§ã³ã§äœ¿çšãããŠããäžéšã®ãµãŒãããŒãã£ã©ã€ãã©ãªããã£ã¹ããªãã¥ãŒã·ã§ã³ã«å ±åãããŠããŸããã å€ãã®é©ãããããŸããããã¡ããããã©ãã«ã®ãã£ã³ããªã³ã¯ãããŒãã£ã³ã°ãšã©ãŒã§ãããããã°ã©ã ã®äœäžãã士å®åè£çãã·ãã¥ã¬ãŒã¿ã§éåžžã¢ãŒãã®ãšã¯ãµãµã€ãºãå®è¡ã§ããªãé倧ãªåé¡ãçºçããŸãã
ãã ããããªãåçŽã§èšç®ãç°¡åãªãã°ã«å€ãã®æéãè²»ããããŸãã æ°ããæ©èœãè¿œå ãããšãå€ãã®å Žåãæ°ãããã°ãããã°ã©ã ã«å°å ¥ãããŸãã ãããã®ã»ãšãã©ã¯ãããŒãžã§ã³ã®äœæ¥äžã§ãã£ãŠãããããžã§ã¯ãã®æ¯æ¥ã®ååž°ãã¹ãã®éçšã§ãã£ãããããŸãã æ°ãããšã©ãŒãçºèŠãããã¹ã¿ãŒã¯ãã©ã®éçºè ããã®ãšã©ãŒã«è²¬ä»»ãè² ã£ãŠããã®ãïŒå¶ç¶ãå¿ ãããæããã§ã¯ãªãïŒãå€æããRedmineã§ã¿ã¹ã¯ãäœæããå¿ èŠããããŸãã ããã°ã©ããŒãåé¡ãç解ããä¿®æ£ãã³ãããããåŸãè¿œå ã®ãã§ãã¯ãå®è¡ããŠãåé¡ãå®éã«è§£æ±ºããã解決ã§ããããšã確èªããå¿ èŠããããŸãã åèšã§ãæãããããªã±ãŒã¹ã§ã¯åå以äžã®å·¥æ°ãåŸãããŸãã ããã¯ããã°ãè¿ éã«åçŸãããããã°ã©ããåé¡ã®å 容ãšã³ãŒãã§ä¿®æ£ããå¿ èŠããããã®ãããã«ç解ããå Žåã§ãã ãšã©ãŒãåçŸããã®ã«20ã30åãããå ŽåãæãéããŠããããªä¿®æ£ã®å Žåã§ãã2å·¥æ°ã®æ倱ã䌎ããŸãã ååãªæ倱ã ãã®ãããªãšã©ãŒã®åå ã¯ãéåžžã®äžæ³šæã«ããããšãå€ããããããã«æ»æçã§ãã
ãããžã§ã¯ãã®éçã³ãŒãåæ
ãããžã§ã¯ãã§éçã³ãŒãã¢ãã©ã€ã¶ãŒã䜿çšããŠã¿ãããšããã¢ã€ãã¢ã¯ãç§ã ãã§ã¯ãããŸããã C ++ Russiaã«ã³ãã¡ã¬ã³ã¹ã®ååãç§ã«æã£ãŠããŠãããã®ã§ããã圌ã¯PVS-Studioã®äººãã¡ã«äŒããŸããã ç§ã¯çŸåšã®ããŒãžã§ã³ãèããŠãªãªãŒã¹ããããã«äžæåæ¢ãããããããã¹ãŠåãããã«è©Šãããšã«ããŸããã PVS-Studioã®éçºè ã«ã¡ãŒã«ã§é£çµ¡ããçãé£çµ¡ã®åŸã2é±éã©ã€ã»ã³ã¹ããŒãåãåãããããžã§ã¯ãã®ãã§ãã¯ãéå§ããŸããã
ããã§ããããžã§ã¯ãã®ã¢ãŒããã¯ãã£ã®æ©èœã«ã€ããŠããã€ãã®èšèãèšãå¿ èŠããããŸãã C ++ã«ã¯ããŸãã³ãŒãããããŸããã çŽ50ã®ã©ã€ãã©ãªã ãã§ããããããã®äžéšã«ã¯æ°åè¡ã®ã³ãŒãããå«ãŸããŠããŸããã ããã°ã©ã ããžãã¯ã®éèŠãªéšåã¯ãã°ã©ãã£ãã¯ãšã³ãžã³ã®ç°å¢ã«ãããŸãã DLLãä»ããŠC ++ã³ãŒãããããžã§ã¯ãã«çµ±åããŸãã ãããã£ãŠãã°ã©ãã£ãã¯ãšã³ãžã³ã®ç°å¢ã§ã¯è¡šãããªãç¹å®ã®æ©èœãå®è£ ããŸãã ããã«ããã¬ãŒã ããšã«åçã«å€æŽããããè¡ç®¡å ã«ããŒãã«ãšã¬ã€ããã¬ã³ããªã³ã°ããããå¿æãåŒåžã®åããã·ãã¥ã¬ãŒãããããã®å€è§åœ¢ã°ãªãããäœæãããããããã«ãDLLè€éãŸãã¯ãªãœãŒã¹éçŽåã¢ã«ãŽãªãºã ã«ç§»è¡ããŸãã C ++ã§ã¯ãå€ç§çä»å ¥ãã·ãã¥ã¬ãŒãããéåã®ããžãã¯ãèšè¿°ãããŠããŸããããã«ãããæè¡ã®æ®µéã®è¿œè·¡ãšå£«å®åè£çã®è¡åã®æ£ç¢ºæ§ãä¿èšŒãããŸãã ãã®çµæããããžã§ã¯ãã«ã¯ããã€ãã®éåžžã«å°ããªC ++ã©ã€ãã©ãªãšããããã2ã3ååãå«ãããã€ãã®äžèŠæš¡ã®ã©ã€ãã©ãªããããŸãã ã°ã©ãã£ãã¯ãšã³ãžã³ã®ç°å¢ã«ããããã°ã©ã ããžãã¯ã®éšåã«ã€ããŠã¯ãéçã³ãŒãåæã®ããã®èå³æ·±ãããŒã«ã¯äœ¿çšã§ããŸããã ãã®ããããããžã§ã¯ãã®äžéšã®ã¿ãPVS-Studioã§ãã¹ãããŸããã
PVS-Studioãç§ã®ã³ã³ãã¥ãŒã¿ãŒã«ç°¡åãã€æ¥œã«ç«ã¡äžãã£ãŠVisual Studio 2013ã«çµ±åãããŸãããPVS-StudioããŒã ã®Andrey KarpovããŠãŒã¶ãŒããã¥ã¢ã«ãžã®ãªã³ã¯ãšã¯ã€ãã¯ã¹ã¿ãŒãã¬ã€ãã®ãããªãã®ãéã£ãŠãããŸãããéçã¢ãã©ã€ã¶ãŒã®ã€ã³ã¿ãŒãã§ãŒã¹ãšæ©èœã¯ãçŽæçã§ç§åŠçãªçªé²æè¡ã䜿çšããŠã®ã¿å®è¡ã§ããŸãã
15ååŸãåèãä»ããŠXç·é 圱å€ãæ¡æ£ããããã»ã¹ã®ã¢ããªã³ã°ãæ åœããDLLã³ãŒããæ¢ã«ãã§ãã¯ããŸããã ãã®ã©ã€ãã©ãªã«ã¯ãçŽ4000è¡ã®ã³ãŒããå«ãŸããŠããŸãã ã¢ãã©ã€ã¶ãŒãSolutionã®æåã®ã¬ãã«ã®ãšã©ãŒãèšé²ããªãã£ãããšã«å°ãé©ããŸããã ãã ãããã®ãœãªã¥ãŒã·ã§ã³ã¯ãã§ã«æ°åæéã®ãã¹ãã«åæ ŒããŠãããæè¿ã¯å®å®ããŠæ©èœããŠããããšã«æ³šæããŠãã ããã ããã§ãéçã¢ãã©ã€ã¶ãŒã¯äœã«æ³šæãæã£ãŠããŸããïŒ
V550å¥åŠãªæ£ç¢ºãªæ¯èŒïŒtïŒ=0ãå®çŸ©ããã粟床ã®æ¯èŒã䜿çšããæ¹ãããããè¯ãïŒfabsïŒA-BïŒ> Epsilonã objectextractpart.cpp 3401
D3DXVECTOR3 N = VectorMultiplication( VectorMultiplication(V-VP, VN), VN); float t = Qsqrt(Scalar(N, N)); if (t!=0) { N/=t; V = V - N * DistPointToSurface(V, VP, N); }
ãã®ã©ã€ãã©ãªã§ã¯ãåæ§ã®ãšã©ãŒãé »ç¹ã«ç¹°ãè¿ãããŸãã ãããç§ã«ãšã£ãŠé©ãã ã£ããšã¯èšããŸããã 以åããã®ãããžã§ã¯ãã§æµ®åå°æ°ç¹æ°ã«é¢ãã誀ã£ãäœæ¥ã«ééããŸããã ãã ãããœãŒã¹ãäœç³»çã«ç¢ºèªãããªãœãŒã¹ã¯ãããŸããã§ããã æ€èšŒã®çµæã«ããã°ãéçºè ã«æµ®åå°æ°ç¹æ°ãæ±ããšãã芳ç¹ã§èŠéãåºããããã«èªããã®ãäžããå¿ èŠãããããšãæããã«ãªããŸããã ç§ã¯åœŒã«ããã€ãã®è¯ãèšäºãžã®ãªã³ã¯ãæããŸããã çµæãèŠãŠã¿ãŸãããã ãã®ãšã©ãŒãããã°ã©ã ã§å®éã®èª€åäœãåŒãèµ·ãããã©ãããæ確ã«èšãããšã¯å°é£ã§ãã çŸåšã®ãœãªã¥ãŒã·ã§ã³ã¯ãæŸå°ç·äžééæ§ç©è³ªã®æ¡æ£ãããã«æ²¿ã£ãŠã·ãã¥ã¬ãŒãããããåèã®åæå€è§åœ¢ãããã¯ãŒã¯ã®å€ãã®èŠä»¶ãèšå®ããŸãã èŠä»¶ãæºããããŠããªãå Žåãããã°ã©ã ãã¯ã©ãã·ã¥ããããæããã«æ£ããåäœããªãããšããããŸãã ãããã®èŠä»¶ã®äžéšã¯åæçã«ååŸãããäžéšã¯çµéšçã«ååŸãããŸãã èŠä»¶ã®ãã®2çªç®ã®éšåã¯ãæµ®åå°æ°ç¹æ°ã®èª€ã£ãåŠçã ãã§å€§ãããªãå¯èœæ§ããããŸãã æµ®åå°æ°ç¹æ°ã®æ£ç¢ºãªæ¯èŒã䜿çšããŠèŠã€ãã£ããã¹ãŠã®ã±ãŒã¹ããšã©ãŒã§ãã£ãããã§ã¯ãªãããšã«æ³šæããŠãã ããã
V807ããã©ãŒãã³ã¹ã®äœäžã 'Duct.TR [cIT]'åŒãç¹°ãè¿ã䜿çšããªãããã«ãåç §ãäœæããããšãæ€èšããŠãã ããã objectextractpart.cpp 2689
for (k = 0; k < Duct.LIsize; k++) { cIT = Duct.ListIT[k]; if(DuctMain.TR[cIT].inScreen &&(Duct.TR[cIT].PNum > OneDev512)) { tuv[0].y = Duct.TR[cIT].v0 * Duct.TR[cIT].PNum; .... } .... }
ãœãªã¥ãŒã·ã§ã³å ã®çŽ20ã®åæ§ã®ã¡ãã»ãŒãžã èå³æ·±ãããšã«ããã®ã©ã€ãã©ãªã«ã¯éåžžã«é«ãããã©ãŒãã³ã¹èŠä»¶ããããŸãã ãã¯ãã«ãšè¡åãæ±ãé¢æ°ã§ã¯ãæåéããã¹ãŠã®ä¹ç®ãäžåºŠã«èæ ®ãããä¿åããå Žæãæ¢ããŸããã ãã®ã³ãŒãäŸã®ã«ãŒãã¯ãéåžžã«å€æ°ã®å埩åŠçïŒæ倧æ°äžåïŒãç¹°ãè¿ããŸãã è¡ç®¡é 圱ã¬ã³ããªã³ã°ãæäŸããããŒãã£ã¯ã«ã·ã¹ãã ã¢ã«ãŽãªãºã ã®äžéšã§ãã éèŠç»åã®æŸå°ç·äžééæ§ç©è³ªã®èŠèŠåã®ç¹åŸŽã¯ããã¬ãŒã ã®å¹³é¢ã«åçŽã«åããããè¡ç®¡ãããæãèŠããããšã§ãã ãã®å ŽåãXç·ã¯è¡ç®¡ã«æ²¿ã£ãŠééããŸããã€ãŸããåžååªäœã®ãã倧ããªå±€ãééããããæžè¡°ãããæ圱å ã®ãã£ã«ã ãç §ãããŸããã ããã°ã©ã ã§ã®ãã®å¹æã¯ãåèã®å€è§åœ¢ãããã¯ãŒã¯å ã«åæ£ãããåéæã®ç²åã®ã·ã¹ãã ã«ããéæãããŸãã å€è§åœ¢ã¡ãã·ã¥ã¯éåžžã«è©³çŽ°ã§ãã ã·ã¹ãã å ã®ç²åãããããéåžžã«å€§ããã§ãã å®éšãè¡ãããšã¯èå³æ·±ãã§ãããã ã³ãŒãå ã®ãããã®æŽç·ŽãããŠããªãå Žæãä¿®æ£ããããšã§ã1ã2ããªç§åã€ããšãã§ããŸããïŒ ããããã³ã³ãã€ã©ã¯ãã®æé©åãèªåçã«è¡ããŸããããã³ããäžããŠã¯ã©ãã§ããããã
V669ã¡ãã»ãŒãžïŒãcITãããjãåŒæ°ã¯éå®æ°åç §ã§ãã ã¢ãã©ã€ã¶ãŒã¯ããã®åŒæ°ãå€æŽãããŠããäœçœ®ãå€å¥ã§ããŸããã é¢æ°ã«ãšã©ãŒãå«ãŸããŠããå¯èœæ§ããããŸãã objectextractpart.cpp 2406
D3DXVECTOR3 ObjectExtractPart::GetD(D3Object& Duct, int& cIT, int& j){ return DuctMain.VP[DuctMain.TR[cIT].IP[2]].P + ( DuctMain.VP[DuctMain.TR[cIT].IP[0]].P - DuctMain.VP[DuctMain.TR[cIT].IP[2]].P + ( DuctMain.VP[DuctMain.TR[cIT].IP[1]].P - DuctMain.VP[DuctMain.TR[cIT].IP[0]].P ) * Duct.TR[cIT].tt[j].x ) * Duct.TR[cIT].tt[j].y + DuctMain.TR[cIT].CNR * Duct.TR[cIT].tt[j].z; }
ãã®å Žåãã³ãŒãã¯æ£ããã§ãã ããã°ã©ããŒã®ãšã©ãŒã¯ãé¢æ°ãã©ã¡ãŒã¿ãŒã®èª€ã£ã説æã«ã®ã¿ãããŸãã ãããã¯const intïŒã§ããã¹ãã§ããã
æåã®è¢«éšè ã§é©ãã»ã©å°æ°ã®é倧ãªãšã©ãŒãçºèŠãããããç§ãã¡ã¯çŸæç¹ã§ããç©æ¥µçã«æ¡å€§ãããœãªã¥ãŒã·ã§ã³ã«é²ã¿ãŸããã 次ã®ãã¹ã察象ã¯ãã°ã©ãã£ãã¯ãšã³ãžã³ããå€ç§çä»å ¥ãã·ãã¥ã¬ãŒãããããã®æŒç¿ã®è«çã³ãŒããžã®ä»®æ³ä»å ¥äžã«äœãèµ·ãã£ãŠãããã«é¢ããããŒã¿è»¢éãæäŸãã8ã€ã®ã©ã€ãã©ãªã§æ§æãããŠããŸãã ããšãã°ã士å®åè£çã®ãšã©ãŒãéç¥ããããä»å ¥ãã§ãŒãºã®å®äºãç¥ãããããã«ãå察æ¹åã®ããŒã¿è»¢éãåãã©ã€ãã©ãªã«ããã£ãŠããŸãã ãã®ãããã°ã©ãã£ãã¯ãšã³ãžã³ã®ç°å¢ã«æ¥ç¶ããã«ãC ++ã§ã®ã¿æŒç¿ã®ããžãã¯ãèšè¿°ã§ããŸãã
ããã§ãåç©«ã¯ãã§ã«ããå°è±¡çã§ãããã³ãŒãå ã«éåžžã«å±éºãªå Žæãããã€ãèŠã€ãããŸããã
V595ã¡ãã»ãŒãžïŒ '_idiChannel'ãã€ã³ã¿ãŒã¯ãnullptrã«å¯ŸããŠæ€èšŒãããåã«äœ¿çšãããŸããã è¡ã確èªïŒ917ã918ãlogicinterface.cpp 917
int instType = _idiChannel->GetActiveInstrumentTypeInGroup(instrumentId); if (_alogChannel != NULL && _idiChannel != NULL) { .... }
æœåšçãªã¯ã©ãã·ã¥ãµã€ãã ãããŸã§ã¢ããªã±ãŒã·ã§ã³ããã®æ®µéã§åäœããŠãããšãã_idiChannelãã€ã³ã¿ãŒãNULLã§ã¯ãªãã£ãããããã¹ãã§ã¯ãã®ãšã©ãŒã¯ä»¥åã«ã¯æããã«ãªããŸããã§ããã ããããä»åŸã®éçºã§ç¶æ³ãå€ãããªãããšãä¿èšŒãã人ã¯ããŸããããŸãã以åãããžã§ã¯ãã«çµã¿èŸŒãŸããŠãããã®ãã°ãé¡åšåããããšã¯ä¿èšŒãããŸããã
V688 'chCameraMatrix'ããŒã«ã«å€æ°ã¯ãã¯ã©ã¹ã¡ã³ããŒã®1ã€ãšåãååãæã£ãŠãããããæ··ä¹±ãæãå¯èœæ§ããããŸãã angiographlog.cpp 323
class ANGIOGRAPHLOG_API AngiographLog: public ILogic { .... Aco_Matrix* chCameraMatrix; Aco_Matrix* chProjectionMatrix; .... } D3DXMATRIX AngiographLog::GetCameraMatrix() { D3DXMATRIX res; Aco_Matrix* chCameraMatrix=(Aco_Matrix*)GetChild(CameraMatrix); if ( chCameraMatrix != NULL) { res = chCameraMatrix->GetMatrix(); } return res; }
Solutionã®ç°ãªããã¡ã€ã«ã®4ã€ã®ãã®ãããªããªã¬ãŒã ãã®å Žåããšã©ãŒã¯çºçããŸããã§ããã ããããå°æ¥çã«ã¯ãã³ãŒãå ã§åæåãããŠããªããã€ã³ã¿ãŒã®èª€è§£ã䜿çšã«ã€ãªããå¯èœæ§ããããŸãã
V522ãã«ãã€ã³ã¿ãŒãchInstrumentSubLineLengthInãã®éåç §ãè¡ãããå ŽåããããŸãã instrumentdatainterface.cpp 239
D3DXVECTOR3 InstrumentDataInterface::GetSubLineEndPos(....) { .... if(chInstrumentSubLineLengthIn != NULL) chInstrumentSubLineLengthIn->SetFloat(subLineLengthIn); else chInstrumentSubLineLengthIn->SetFloat(0.0F); .... }
ããã§ãç§ãæ³åããŠããããã«ãéçºè ã¯æåã«æåã®2è¡ã®ã³ãŒããäœæããŸããã ãããã圌ã¯äœãã«æ°ãåãããŸããã ããã¯éåžžã«éèŠãªããšã§ãã åã³ã³ãŒãã®äœæ¥ã«æ»ã£ãŠã圌ã¯ãã§ã«æãããªæãããè¿œå ããŠããŸããã ããã¯èµ·ãããŸãã ãããŠãã®éã«ãæœåšçãªããã°ã©ã ã¯ã©ãã·ã¥ã®å Žæãã³ãŒãã«çŸããŸããã
ãã€ã³ã¿ãŒã䜿çšããäœæ¥ãæ£ããè¡ãããªãã£ããããã³ãŒãå ãä»ã®ã©ã€ãã©ãªå ã«å±éºãªå ŽæããããŸããã
V614æœåšçã«åæåãããŠããªããã€ã³ã¿ãŒ 'tabAntiPowerSpheres'ã䜿çšãããŸããã getnewposbyheartbeat.cpp 175
void GetNewPosByHeartBeat::_precalc() { .... STL_Table *stlAntiPowerSpheres; CSTL_Table *tabAntiPowerSpheres; stlAntiPowerSpheres = (STL_Table *)GetChild(....); if (stlAntiPowerSpheres != NULL) tabAntiPowerSpheres = stlAntiPowerSpheres->getSTL_Table(); if (tabAntiPowerSpheres != NULL) { int tableSize = tabAntiPowerSpheres->getRowCount(); .... } .... }
ä»åã¯ããšã©ãŒãå°ããããã«ãããªããŸããã stlAntiPowerSpheresãNULLã§ããããšãå€æããå ŽåãtabAntiPowerSpheresã¯åæåãããã«æ®ããã©ã³ãã ãªã¡ã¢ãªé åã瀺ããŸãã NULLã®ãã§ãã¯ã«åæ Œãããšããªããžã§ã¯ãã®ãã£ãŒã«ãã«ã¢ã¯ã»ã¹ãããšããã°ã©ã ãã¯ã©ãã·ã¥ããŸãã ãããããã³ãŒãã®ã©ãã§ããåŒã³åºãïŒSTL_Table *ïŒGetChildïŒCH_ANTIPOWER_SPHERESïŒãNULLãè¿ããªãã£ãããããã¹ãã§ã¯ãã®ç¹ãæããã«ãªããŸããã§ããã
æçµçã«ããã¹ããããŠããªããœãªã¥ãŒã·ã§ã³ãéçã¢ãã©ã€ã¶ãŒã§ç¢ºèªããããšã«ããŸãããããã¯ãŸã éçºäžã§ãããã¡ã€ã³ãããžã§ã¯ãã«ã¯å®è£ ãããŠããŸããã ãã®ãœãªã¥ãŒã·ã§ã³ã®äžç°ãšããŠãæè»ãªæååã®ç¬èªã®ç©çãšã³ãžã³ã®äœæã«åãçµãã§ããŸãã ãã§ã«ä»ã®ãšã©ãŒããããŸããã ããšãã°ãããã«é¢çœãå±ç€ºããããŸãïŒ
V527åœã®å€ããboolãã¿ã€ãã®ãã€ã³ã¿ãŒã«å²ãåœãŠãããã®ã¯å¥åŠã§ãã ããããæå³ïŒ* outIsInScene = falseã rpscene.cpp 79
bool rpScene::CheckIsRopeInScene(...., bool* outIsInScene) { if (mEngine == NULL) { outIsInScene = false; return false; } else { *outIsInScene = mEngine->CheckIsRopeInScene(ropeToCheck); return true; } }
ããã§ããã®å Žåã®ã¢ãã©ã€ã¶ãŒã¯éšåçã«ããæ£ãããªãããšã«æ³šæã§ããŸãã outIsInSceneãã©ã¡ãŒã¿ãŒã¯ãã€ã³ã¿ãŒã§ãã£ãŠã¯ãªããŸããã ãšã«ãããã³ãŒãå ã®ãã®çãããå ŽæãææããŠãããŠããããšãã æ¬åœã«ééãã
ããã§ã¯ãã¹ãŠã®ããªã¬ãŒãæäŸããŸããã æåŸã«æ³šæãåŒããã®ã¯2ã€ã ãã§ãã
V501ã||ãã®å·Šãšå³ã«åäžã®ãµãåŒãïŒfabsïŒcrossVect.xïŒ> 1.192092896e-07FïŒãããããŸã æŒç®åã rpmath.h 103
inline bool IsCollinearVectors(Vector3d vect1, Vector3d vect2) { Vector3d crossVect = Vector3dMultiply(vect1, vect2); // ; return !((fabs(crossVect.x) > FLT_EPSILON) || (fabs(crossVect.y) > FLT_EPSILON) || (fabs(crossVect.x) > FLT_EPSILON)); }
ããã§ãäžæ¹ã§ã¯ãããã°ã©ããŒã®äžæ³šæããçããããããééãããããŸãã ããããäžæ¹ã§ãããã°ã©ã ã®çµæãçŽæ¥èŠ³å¯ãããã¹ãã§åã ã®ã¡ãœããã®ããã©ãŒãã³ã¹ããã¹ãããªãå Žåããã®ãããªãšã©ãŒãèŠã€ããã®ã¯éåžžã«å°é£ã§ãã ãã®é¢æ°ã§ã¯ã2ã€ã®ãã¯ãã«ã®å ±ç·æ§ããã§ãã¯ãããŸããã ããšãã°ãè¡çªãªããžã§ã¯ãã暪åã匟æ§åŒŠã®ãã€ã³ãã®æœåšçãªå€äœã®ãã¯ãã«ããç¹å®ã®ä»®å®ã§ã亀差ç¹ã§ã®è¡çªãªããžã§ã¯ãã®è¡šé¢ã®æ³ç·ãšåäžçŽç·äžã«ããå Žåãããã¯ãªããŠã³ãã®èšç®æ¹æ³ã«åœ±é¿ããŸãã ããããå€ãã®çžäºã«é¢é£ããèŠå ãç©çã¢ãã«ã«åœ±é¿ãäžãããããåäœäžã®ããã°ã©ã ã芳å¯ãããšã1ã€ãŸãã¯å¥ã®äžé©åãªåäœã®åå ãæ£ç¢ºã«èšãããšãåžžã«å¯èœãšã¯éããŸããã ãããŠãç§ãã¡ã¯éåžžã«é·ãéãã®ééãã«æ°ä»ããªãã£ãã
ã¢ãã©ã€ã¶ãŒã®å¥ã®èå³æ·±ãäœåããããŸããã æåã¯ãã¢ãã©ã€ã¶ãŒãã³ãŒãèªäœã§ã¯ãªããæååãªãã©ã«ã«äœããçã£ãŠããããããšã©ãŒãäœã§ãããããç解ã§ããŸããã§ããã
V691å®èšŒåæã æååãªãã©ã«ãout_Radiusãå ã«ã¿ã€ããã¹ãååšããå¯èœæ§ããããŸãã ãRADIUSããšããèšèã¯çãããã rpropeinstancecommand.cpp 93
.... mCommandsDescriptions[currCommandNr].name = "Get Rope Fragments Count(Rope;out_Count)"; .... mCommandsDescriptions[currCommandNr]. params[PARAM_NR_FRAGMENTS_COUNT].name = "out_Radius"; ....
ããããã¢ãã©ã€ã¶ãŒã¯ã±ãŒã¹ã«ã€ããŠåªãããããŠããŸãããå®éãå¥ã®æååãªãã©ã«ãããã¯ãã§ãã ãã®æç¹ã§ã®æååãout_Radiusãã¯ããã©ã°ã¡ã³ãããã³ããŒã¢ã³ãããŒã¹ãããçµæãå°ãé«ããªã£ãŠããŸãã ãã®åŸãã³ãŒãå ã§äœãã眮ãæããããŸããããããã§é©åãªout_Countã«æååãªãã©ã«ãä¿®æ£ããã®ãå¿ããŠããŸããã
ã³ããŒå ã®ã³ãŒãã¯æ¬¡ã®ãšããã§ãã
.... mCommandsDescriptions[currCommandNr].name = "Get Rope Fragment Radius(Rope; in_FragmentNr;out_Radius)"; .... mCommandsDescriptions[currCommandNr]. params[PARAM_NR_FRAGMENT_RADIUS].name = "out_Radius"; ....
ã©ãããŠçµãã£ãã®ïŒ
ãã®ãããªãããžã§ã¯ãã®1åéãã®æ€èšŒã¯ãå€ãã®å©çããããããªãããšã¯æããã§ãã æ¢åã®ã³ãŒãã¯ãã§ã«ããªãé·ããã¹ãã«åæ ŒããŠããŸãã ãšã©ãŒã¯ããã»ã©å€ããããŸããããŸããååšãããšã©ãŒã®å€ãã¯ãéåžžã®ããã°ã©ã æäœäžã«ã¯çŸããŸããã PVS-Studioã©ã€ã»ã³ã¹ãè³Œå ¥ããŸããïŒ ãã®ãããªããŒã«ããããžã§ã¯ãã«å°å ¥ããããšã«ååããªå§¿å¢ãæã£ãŠããŸãã æããã«ãéçåæã䜿çšãããšããã¹ã¿ãŒãããã«ã¯éçºè ã®ãªãœãŒã¹ã®äžéšã解æŸãããŸãã Redmineã§ã¯ããšã©ãŒãã©ãã«ãŒã®ã¿ã¹ã¯ãå°ãªããªããŸãã 解決ãããã¿ã¹ã¯ã¯ãä¿®æ£ã®ããã«ãã¹ã¿ãŒããè¿ãããå¯èœæ§ãäœããªããŸãã ãã ããæçµæ±ºå®ãäžãåã«ãPVS-Studioãããããåæ¥çã¡ãªãããæ£ç¢ºã«è©äŸ¡ããããã補åèªäœã®ã³ã¹ããšæ¯èŒããå¿ èŠããããŸãã ãã®è©äŸ¡ã¯ããã®ãããžã§ã¯ãã§ã¯C ++ã§åçã«éçºãããã³ãŒããæ¯èŒçå°ãªããšããäºå®ã«å€§ãã圱é¿ãããŸãã ãããŸã§ã®ãšããããã®ããŒã«ãªãã§äœæ¥ãç¶ããŠããŸãã
ã¬ãã¥ãŒ
ãŸããEidos-Medicineã®ä»ã®ãããžã§ã¯ãããŒã ã®éçºè ã«äžæçãªã©ã€ã»ã³ã¹ããŒãæž¡ããŸããã ç§ã¯ã圌ãã圌ãã®ä»äºã§ãã®ãããªéå ·ãå¿ èŠãšãããã©ããã«ã€ããŠçµè«ãäžãããã«è©Šã¿ãŠæ¬²ããã£ãã èšäºã§ããã€ãã®ã¬ãã¥ãŒãè¡ããŸãã
- è ¹è é¡æè¡ã®ã·ãã¥ã¬ãŒã¿ãŒã®éçºããŒã ã®ããã°ã©ããŒã§ãããã³ã©ã€ã¯ããæªãããšã§ã¯ãããŸããã åæåãããŠããªããã€ã³ã¿ãŒãšãããã®å±éºãªäœæ¥ãèŠã€ãããŸããã
- ç£æ¥çšããããã®ãœãããŠã§ã¢ããŒã ã®ããã°ã©ããŒã§ãããªã¬ã°ã¯ã次ã®ããã«èªã£ãŠããŸãã ããããå€ããããžã§ã¯ãã«è©°ã蟌ãã®ã¯é£ããã§ãã ã9kã®èŠåããããŸãã 確ãã«ããå€ããã®ã¯ãã¹ãŠç¡èŠããæ°ãããšã©ãŒã®ã¿ãæ¢ããã¢ãŒãããããŸãïŒãã®ãããžã§ã¯ãã®ã¢ãã©ã€ã¶ãŒèŠåã®å€ãã¯ããã¯ãäžéšã§ã¯ãªããšããäºå®ã«ãã£ãŠèª¬æãããŠããŸããããã¹ãŠã®ã³ãŒãã¯C ++ã§èšè¿°ãããŠããŸãããããžã§ã¯ãããŒã ã¯èãã倧ãããªã£ãŠããŸããïŒ
- ããŒãã³ãç£æ¥çšããããã®ãœãããŠã§ã¢ããŒã ã®ããã°ã©ããŒïŒã䟿å©ãªããšã§ãããæã«1å以äžäœ¿çšããã®ã¯æå³ããªããšæããŸããã
Andrei Karpovã¯æåŸã®ã³ã¡ã³ãã«å¿çããèšäºã§åœŒã®çããæ±ããŸããã
ããã¯éå¹ççãªäœ¿çšäŸã§ãããåèšäºã§èŠåããããã«ããŠããŸãã ç°¡åã«èšãã°ããšã©ãŒãæ©ãæ€åºãããã»ã©è¯ãã§ãã éçåæã䜿çšããŠã³ã³ãã€ã«ããçŽåŸã«ãããã¬ãèŠã€ãã£ãå Žåããããã¬ãå®è¡ããŠã¿ã€ããã¹ãæ¢ãããšã¯æå³ããããŸããã
ã¢ãã©ã€ã¶ãŒãå®æçã«äœ¿çšããªãçç±ããã®é ãåäœã«ããå Žåã¯ãäœæ¥é床ãäžããããã®ãã³ããç¥ãããšãææ¡ããŸãã ãããã圌ãã¯å©ããã§ãããã ããã§ãªãå Žåã¯ãåžžã«èªåå€éãã§ãã¯ãæŽçã§ããŸãïŒãã¹ãŠãããé©åã«æŽçããæ¹æ³ã玹ä»ããŸãïŒã
çç±ãããŸãã«ãå€ãã®èŠåã§ããå Žåãåå¿è ã¯ãã¹ãŠã®èŠåãåé€ããæ°ããèŠåã®ã¿ã§äœæ¥ã§ããŸãïŒ å€§èŠæš¡ãããžã§ã¯ãã«éç解æãçµã¿èŸŒãæ¹æ³ ïŒã
ãã®èšäºã§ã¯ãAdele Valeev enzo2uã®åçã䜿çšããŸãã ã