Skip to content

Commit

Permalink
Merge pull request #2384 from AndrewEdwards/2.066
Browse files Browse the repository at this point in the history
Cherry-picking commits from master to 2.066 branch (for RC1)
  • Loading branch information
Михаил Страшун committed Jul 31, 2014
2 parents c338935 + 8888970 commit ff13351
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
11 changes: 4 additions & 7 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ MAKEFILE = $(firstword $(MAKEFILE_LIST))

# Main target (builds the dll on linux, too)
ifeq (linux,$(OS))
all : $(LIB) $(LIBSO)
all : lib dll
else
all : $(LIB)
all : lib
endif

install :
Expand All @@ -270,7 +270,7 @@ depend: $(addprefix $(ROOT)/unittest/,$(addsuffix .deps,$(D_MODULES)))

.PHONY: lib dll
lib: $(LIB)
dll: $(LIBSO)
dll: $(ROOT)/libphobos2.so

$(ROOT)/%$(DOTOBJ): %.c
@[ -d $(dir $@) ] || mkdir -p $(dir $@) || [ -d $(dir $@) ]
Expand All @@ -279,10 +279,7 @@ $(ROOT)/%$(DOTOBJ): %.c
$(LIB): $(OBJS) $(ALL_D_FILES) druntime_libs
$(DMD) $(DFLAGS) -lib -of$@ $(DRUNTIME) $(D_FILES) $(OBJS)

$(ROOT)/libphobos2.so: $(ROOT)/$(SONAME)
ln -sf $(notdir $(LIBSO)) $@

$(ROOT)/$(SONAME): $(LIBSO)
$(ROOT)/libphobos2.so: $(LIBSO)
ln -sf $(notdir $(LIBSO)) $@

$(LIBSO): override PIC:=-fPIC
Expand Down
12 changes: 10 additions & 2 deletions std/utf.d
Original file line number Diff line number Diff line change
Expand Up @@ -1134,8 +1134,8 @@ private dchar decodeImpl(bool canIndex, S)(auto ref S str, ref size_t index)
else
return new UTFException("Attempted to decode past the end of a string");
}

assert(fst & 0x80);
if((fst & 0b1100_0000) != 0b1100_0000)
throw invalidUTF(); // starter must have at least 2 first bits set
ubyte tmp = void;
dchar d = fst; // upper control bits are masked out later
fst <<= 1;
Expand Down Expand Up @@ -2020,6 +2020,14 @@ void validate(S)(in S str) @safe pure
}


unittest // bugzilla 12923
{
assertThrown((){
char[3]a=[167, 133, 175];
validate(a[]);
}());
}

/* =================== Conversion to UTF8 ======================= */

pure
Expand Down

0 comments on commit ff13351

Please sign in to comment.