Fix off by one in .debug value.

This commit is contained in:
Axel Naumann 2015-03-23 10:02:50 +01:00 committed by sftnight
parent 7d189c2665
commit 5fa5b84d2b

View File

@ -258,8 +258,8 @@ namespace cling {
clang::CodeGenOptions::LimitedDebugInfo,
clang::CodeGenOptions::FullDebugInfo
};
if (*mode > sizeof(DebInfos))
mode = sizeof(DebInfos);
if (*mode >= sizeof(DebInfos))
mode = sizeof(DebInfos) - 1;
else if (*mode < 0)
mode = 0;
CGO.setDebugInfo(DebInfos[*mode]);