mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
whitespace in example for type unions fixed
Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com>
This commit is contained in:
@@ -498,15 +498,15 @@ In some cases, using the type union over the whole algebraic datatype can avoid
|
||||
For example, the following construction is legal::
|
||||
|
||||
newtype InitialValueSource =
|
||||
ExplicitInitialization(VarDecl v) { exists(v.getInitializer()) } or
|
||||
ParameterPassing(Call c, int pos) { exists(c.getParameter(pos)) } or
|
||||
UnknownInitialGarbage(VarDecl v) { not exists(DefiniteInitialization di | v = target(di)) }
|
||||
ExplicitInitialization(VarDecl v) { exists(v.getInitializer()) } or
|
||||
ParameterPassing(Call c, int pos) { exists(c.getParameter(pos)) } or
|
||||
UnknownInitialGarbage(VarDecl v) { not exists(DefiniteInitialization di | v = target(di)) }
|
||||
|
||||
class DefiniteInitialization = ParameterPassing or ExplicitInitialization;
|
||||
|
||||
VarDecl target(DefiniteInitialization di) {
|
||||
di = ExplicitInitialization(result) or
|
||||
exists(Call c, int pos | di = ParameterPassing(c, pos) and
|
||||
di = ExplicitInitialization(result) or
|
||||
exists(Call c, int pos | di = ParameterPassing(c, pos) and
|
||||
result = c.getCallee().getFormalArg(pos))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user